Forum Navigation
ServerSocket issue
Posted: 04/21/08 10:34:23Hi, I am using ThreadPool? to handle incoming connections to a server, and have been fighting with a bug in ServerSocket?.accept and SocketConduit?.detach for while which causes my server to crash when accepting a connection or sometimes when the handler I'm using is freed, finally think I have found the problem, as I haven't been able to crash the server after my changes. My handler class was deleting the SocketConduit? that the ServerSocket? had created, causing the accept function to segfault, I believe due to SocketConduit? freelist. There needs to be some documentation of that in the SocketConduit? Docs I think. Also when The handler closes it closes any connections it has opened, this was sometimes causing a segfault in SocketConduit?.detach, I fixed it by just not calling SocketConduit?.close.
What is the correct way to use SocketConduit? and ServerSocket??
Am I causing memory leeks by not calling close, (I would like to call close, because the remote end will not allow me to connect if the number of connections gets to high)
Because I don't close the sockets the seem to be staying in CLOSE_WAIT state, is this a Tango bug, or am I doing some thing wrong?
-Rory