I have tried to write nonblocking TCP client using function “select”. Application works correctly when TCP server is running. But, when TCP server on destination machine is not running then function “recv” return error code ECONNREFUSED and so I close the socket and create new one and then call function “connect” on this socket. After about 300 cycles, function “select” return error code ENOMEM (12) and main thread freeze in function “select”.
I also tried not to close the socket but when I call function “connect” on this socket again, it returns with error code ENOTCONN (128).
Am I doing anything bad or it is problem in NETOS ?