[ENet-discuss] Basic PeerID question

Darrell Bircsak dbircsak at gmail.com
Tue Jul 5 20:51:09 PDT 2005


Howdy.  When you have created a server (host) with a peerCount of 32,
for example, and then try to connect out to another host....

peer = enet_host_connect(server, &address, 1);

...ENet will nicely pick an available peer from the 32.  I was
wondering how do I know which one it picked?  Would I look at
peer->incomingPeerID after a successful host_connect to get which peer
it is in the server->peers array?

if (peer == server->peers[peer->incomingPeerID])
     printf("Woo hoo!\n");

Is this the best way to do this...to use incomingPeerID?

Darrell



More information about the ENet-discuss mailing list