[ENet-discuss] channel confusion

Lee Salzman lsalzman at telerama.com
Sun Jan 18 07:41:25 PST 2004


The only time I can think of packets getting dropped like that are if
there is no actual connection or the connection is still setting up. Are
you calling enet_host_service() and waiting for the connect event to
happen before sending stuff out?

Lee

On Sun, Jan 18, 2004 at 07:25:39AM +0000, Brad Monahan wrote:
> I'm trying to setup two channels for my game project; one for reliable, 
> sequenced packets and one for unreliable, unsequenced packets since I don't 
> want to have any stalling on the unreliable position update packets. I'm 
> having troubles figuring out just how to setup multiple channels though. Up 
> to this point I have just treated the update packets as reliable packets 
> and sent everything over one channel, but I need a bit more performance now.
> 
> Let me know if this is how I should or shouldn't be setting things up:
> 
> On the client, I create a client host and then call enet_host_connect to 
> connect to the server and allocate two channels. When I send a reliable 
> packet, I call the enet_packet_create function with the 
> ENET_PACKET_FLAG_RELIABLE flag specified to create the packet and then send 
> it with a call to enet_peer_send with the channel paramater set to 0 (the 
> channel I'm using for reliable transfers). When I send an unreliable 
> packet, I call the enet_packet_create function with 0 as the flag and send 
> it with a call to enet_peer_send with the chanel paramater set to 1 (the 
> channel I'm using for unreliable transfers). This doesn't seem to be 
> working however. It acts as though every packet is getting dropped or not 
> sent at all, so obviously I'm doing something wrong. How should I be doing 
> this?
> 
> Also, how should I being doing this from the servers point of view? Each 
> time a client connects I should call enet_host_connect with the peers 
> address and a 1 in the channel count paramater to allocate two channels?
> 
> 
> Thanks.
> -Brad
> 



More information about the ENet-discuss mailing list