[ENet-discuss] send a message from a client to client

Erik Beran eberan at gmail.com
Wed Jun 11 03:06:12 PDT 2008


You could try establish a connection between clients, but then you're
traveling into the world of NAT negotiation.  Just try sending the public
address of a clients to all other clients.

If this is for gaming, bear in mind you should probably only send
unimportant things directly from client to client such as voice.  You still
want to have the server as the authority over the game simulation.

If you're really interested in learning how to get passed NAT devices,
google it or check http://en.wikipedia.org/wiki/NAT_traversal

/eBeran

On Wed, Jun 11, 2008 at 10:46 AM, Bjørn Lindeijer <bjorn at lindeijer.nl>
wrote:

> On 5/16/08, Ng Yao Kheng <ngyaokheng at hotmail.com> wrote:
> >
> >  Hi all,
> >
> >  Does anyone know how to send a message from a client to another client
> that
> > is both connected to the server? Appreciate with some example code.
> >
> >  Please advice. Thanks....
>
> Uhm, you would just have to send the message to the server, and the
> server would have to forward it to the other client.
>
> If your architecture requires you to do this frequently, you would
> probably add something like a target client id to the start of each
> message you send to the server, so that the server just reads this
> first and can forward the message directly to the target client.
>
> Hope that helped.
>
> Regards,
> Bjørn
> _______________________________________________
> ENet-discuss mailing list
> ENet-discuss at cubik.org
> http://lists.cubik.org/mailman/listinfo/enet-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubik.org/pipermail/enet-discuss/attachments/20080611/a0a640d2/attachment.htm>


More information about the ENet-discuss mailing list