[Flightgear-devel] Checking if there is a connection with netChannel

2003-12-02 Thread Seamus Thomas Carroll
Hi, I have got the netChannel figured (thanks Bernie) out and the server is accepting multiple clients. The problem is if a client flightgear program is shut down the server still tries to send it information and the server crashes. I tried using netChannel::isConnected() but it returns

RE: [Flightgear-devel] Checking if there is a connection with netChannel

2003-12-02 Thread Norman Vine
Seamus Thomas Carroll writes: On the client side I thought about using netChannel::close to inform the server that the socket is closed but the function is never called. netChannel::close is called in the clients destructor but the destructor is never called because FGGlobals *globals is

RE: [Flightgear-devel] Checking if there is a connection with netChannel

2003-12-02 Thread Seamus Thomas Carroll
I put a cerr delete globals endl; where you have delete globals; in the code below and when I exit flightgear delete globals is not printed. Does the same happen for you? Seamus On Tue, 2 Dec 2003, Norman Vine wrote: Seamus Thomas Carroll writes: On the client side I thought about

Re: [Flightgear-devel] Checking if there is a connection with netChannel

2003-12-02 Thread Bernie Bright
On Tue, 02 Dec 2003 20:40:51 -0500 Norman Vine [EMAIL PROTECTED] wrote: Seamus Thomas Carroll writes: On the client side I thought about using netChannel::close to inform the server that the socket is closed but the function is never called. netChannel::close is called in the clients

Re: [Flightgear-devel] Checking if there is a connection with netChannel

2003-12-02 Thread Seamus Thomas Carroll
Found the solution. When the client is shutdown the server netChannel still thinks the connection is valid and has a handle != -1. This causes a SIGPIPE errors on a send or recieve making an assert to fail. To avoid this problem MSG_NOSIGNAL is passed into the send or recv with this