[ENet-discuss] Peer sessionID as key?

Andrew Fenn andrewfenn at gmail.com
Fri Jan 8 23:29:03 PST 2010


I'm making a lot of use of peer->incomingPeerID in my program. Does
this mean that I shouldn't be using this?

On Sat, Jan 9, 2010 at 10:11 AM, Lee Salzman <lsalzman1 at cox.net> wrote:
> 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
>>
>
> _______________________________________________
> ENet-discuss mailing list
> ENet-discuss at cubik.org
> http://lists.cubik.org/mailman/listinfo/enet-discuss
>


More information about the ENet-discuss mailing list