SDLNet_TCP_Send causes a broken pipe when disconnecting

Hi,

I have a client and a server program. When I kill my client for example, if the server is SENDING a packet to this client at this moment, the server got a broken pipe error message and the server doesn’t shut down cleanly instead of getting the expected sending error message caused by a returned lenght of sended message less than the expected sended lenght.

Note that in the case of the server RECEIVING a packet from the client when this client is killed, it got an expected reception error message caused by the return of the function SDLNet_TCP_Recv which is “-1” (meaning that an error may have occured, in this case, the disconnection of the client). So the error is only focused on SDLNet_TCP_Send.

It only occurs on Linux systems. On Windows systems, if I kill my client and at he same moment, the server is sending a packet to this client, the server got the expected sending error message caused by the number of bytes sent which is less than the expected sended lenght, in this case ‘0’ as the communication channel is broken.

I’m using SDL_net 1.2.5 and SDL 1.2.7 on Windows/Linux systems.

Note that on SDL_net 1.2.4 and SDL 1.2.5, I got a Floating Point Exception instead of a broken pipe error message when facing the same situation on Linux systems.

Thanks in advance and sorry for my poor english.

Sam