Socket liftetime?

Hi there,

I would have some questions about writing/reading from socket.
Actually, I have an application that writes/reads from sockets and every minutes it seems that the socket closes, the ‘send’ function always returns -1 every minutes.
1- So is there a socket lifetime that could be configured?
2- What is the socket limit number?
3- Does ‘closesocket’ release the connection?