[ENet-discuss] Problems getting ENet to work on Solaris

Lee Salzman lsalzman at telerama.com
Sun Sep 14 01:30:37 PDT 2003


One problem I see is you are trying to send a packet over channel 3,
but have only created 2 channels in the connect. If you create 2
channels, these will be numbered 0 and 1, so channel 3 is only available
if you specify that 4 channels are to be allocated. This is most likely
going to cause a crash in the client.

You should also ensure that a connect event is actually received before
sending out packets on the client peer. It may possibly return a
disconnect event if the connect fails.

Lee

On Mon, Sep 08, 2003 at 04:46:05PM -0400, Eberhart, Andrew wrote:
> When I try using enet_host_service in the client program, the server
> crashes with a bus error.
> 
> Here is the meat of what I am trying:
> client:
>    enet_initialize();
>    client = enet_host_create (NULL, 1, 0, 0);
>    enet_address_set_host (& address, "192.168.90.45");
>    address.port = 11234;
>    peer = enet_host_connect (client, & address, 2);
>    enet_host_service (client, & event, 5000);
>    while (1) {
>       packet = enet_packet_create ("stuff", strlen("stuff") + 1,
>          ENET_PACKET_FLAG_RELIABLE);
>       enet_peer_send (peer, 3, packet);
>       enet_host_service (client, & event, 5000);
>    }
> 
> server:
>    enet_initialize();
>    enet_address_set_host (& address, "192.168.90.45");
>    address.port = 11234;
>    server = enet_host_create (& address, 32, 0, 0);
>    while (1) {
>       enet_host_service (server, & event, 1000);
>       ...
>    }
> 
> As soon as the enet_host_service is called on the client after the
> enet_peer_send() function, the server gets a bus error.
> 
> If I use enet_host_flush() instead of the enet_host_service on the
> client, the server does not crash. It behaves as mentioned below.
> 
> What am I doing wrong?
> 
> 			Thanks!
> 			Andrew
> 



More information about the ENet-discuss mailing list