[ENet-discuss] ENET_EVENT_TYPE_DISCONNECT with peer address == 0 + additional questions

Intripoon intripoon at gmx.de
Tue Jul 4 10:58:08 PDT 2006


Hi again!
 
Following your suggestion, I solved my problem by copying ip and port to my
own structure pointed at by peer->data.
 
I've got a few more questions:
 
How do you know when it's save to close a connection if you want to ensure
that the packets you sent arrived. Right now, if I enet_peer_send a packet
with 1000000 bytes in it and then call enet_peer_disconnect afterwards, it
disconnects quite fast (I get ENET_EVENT_TYPE_DISCONNECT quite fast),
without waiting for the packet to arrive. Do I have to wait manually
somehow? I sent the packet with ENET_PACKET_FLAG_RELIABLE.
 
Another thing that made me wonder: If I send the large packet on channel 1.
While it gets transferred, I send small packets of 16 bytes on channel 0.
All ENET_PACKET_FLAG_RELIABLE. Now, I'ld expect the small packets to arrive
before the large packet arrives, because they are small and on another
channel. What happens is, nothing arrives until the large packet got
transmitted. Suddenly, the large packet arrives and all the small ones I
sent in the meanwhile all together. Shouldn't they arrive faster? Like a
large background transfer with small fast packets in the foreground. Is it
supposed to behave like that or did I do anything wrong?
 
Apart from that, enet is a very nice lib. Much better working from the
beginning than all the other libs out there I tried ...
 
Best regards and thanks for your fast reply until now
    Marc
 
  _____  

Von: enet-discuss-bounces at cubik.org [mailto:enet-discuss-bounces at cubik.org]
Im Auftrag von Paul Collier
Gesendet: Dienstag, 4. Juli 2006 18:05
An: Discussion of the ENet library
Betreff: Re: [ENet-discuss] ENET_EVENT_TYPE_DISCONNECT with peer address =
0


Hello,
 
That's funny, I could swear that the address and port data were intact in my
disconnect events... oh well. Anyways, it's recommended that you use
peer->data (void pointer) to identify and distinguish your peers. Just point
to some custom structure with your application data. 
 
Hope this helps,
- Paul

 
On 7/4/06, Intripoon <intripoon at gmx.de> wrote: 


Hi !

I just started to use Enet. While evaluating enet for my needs, I wondered
about this:


"ENET_EVENT_TYPE_DISCONNECT     a peer has disconnected.

This event is generated on a successful completion of a disconnect initiated
by enet_pper_disconnect, if a peer has timed out, or if a connection request

intialized by enet_host_connect has timed out. The peer field contains the
peer which disconnected. "


But if I get a ENET_EVENT_TYPE_DISCONNECT, event.peer->address.host and
event.peer->address.port are 0. How am I supposed to recognize the peer that
disconnected? Directly comparing the event.peer pointer instead?


Best regards
       Marc

_______________________________________________
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/20060704/5dcfa419/attachment.htm 


More information about the ENet-discuss mailing list