[ENet-discuss] Peer sessionID as key?
Lee Salzman
lsalzman1 at cox.net
Fri Jan 8 19:11:08 PST 2010
Don't use sessionID at all. It's an internal thing that is not even
unique across peers.
Inside ENetPeer there is a "void *data". Set that to point to whatever
user data you want. ENet doesn't touch it at all, and it is there for
this purpose.
Lee
Eugene Marcotte wrote:
> Hi,
>
> I'm trying to build a mechanism to lookup peers. I have a sort of c++
> wrapper in the works, and as part of that I am trying to map between the
> peers in events and my c++ peer objects.
>
> I'm currently using the sessionId to key off of the peer, which has been
> working well mostly. However, I just added some 'cleanup' code for handling
> disconnections. When I receive a disconnect event in my client (its a 1-1
> client server at the moment) I get a sessionId of 0. It seems to have the
> correct ID when the server gets a disconnect event.
>
> Is this expected, or am I perhaps doing something wrong? Is there a better
> value to key the peers off of?
>
> Thanks,
> Eugene
>
More information about the ENet-discuss
mailing list