Are you sure you are not comparing the address of the pointer in the event vs the value of the pointer in the event?
On Sat, Mar 30, 2013 at 11:18 PM, Syed Setia Pernama <[email protected]>wrote: > > That is what I thought ENet should be doing, but my case is quite simple > that there is no connection drop (therefore, peer pointer address can be > different). The packet sent and received occurs within less that 0.1 > second, so again, disconnection is out of question. I have solved (probably > workaround) by deriving ip address from both peer pointers.. and now they > are same..! > > ------------------------------ > *From:* Doug Warren <[email protected]> > *To:* Syed Setia Pernama <[email protected]>; Discussion of the ENet > library <[email protected]> > *Sent:* Friday, March 29, 2013 11:23 PM > *Subject:* Re: [ENet-discuss] ENetPeer pointer comparison.. > > Start of enet_host_create(): > host -> peers = (ENetPeer *) enet_malloc (peerCount * sizeof > (ENetPeer)); > > The list of peers is created at the time the host is created and is reused > same with channels, buffers, and some uses of commands. > > > On Fri, Mar 29, 2013 at 7:43 AM, Syed Setia Pernama <[email protected]>wrote: > > Hi, > > I am 80% sure nothing wrong is with my code. Here I copy+paste the log:- > > 22:12:48: Pinging peer (pointer=29411384, ip = 10.1.1.10) > 22:12:48: Pinging peer (pointer=29411764, ip = 10.1.1.30) > 22:12:48: ID_GENERAL_PING (pointer=29412144) > > What happened is I ping (using my own structure) two peers which has > ENetPeer pointer address = 29411384 & 29411764. And then the peer is > supposed to reply back, and I compare the ENetPeer > stored in ENetEvent, and they are not the same! 29412144 is not the same > with both (29411384 & 29411764). What I was hoping is the ENetPeer stored > in ENetEvent should equal to either one, > and therefore my code works. > > Question: > Can anyone confirm that ENet indeed create a new copy of ENetPeer (not > reusing it) for the above case? > > TIA. > > > _______________________________________________ > ENet-discuss mailing list > [email protected] > http://lists.cubik.org/mailman/listinfo/enet-discuss > > > > > > _______________________________________________ > ENet-discuss mailing list > [email protected] > http://lists.cubik.org/mailman/listinfo/enet-discuss > >
_______________________________________________ ENet-discuss mailing list [email protected] http://lists.cubik.org/mailman/listinfo/enet-discuss
