Home > other >  Socket option SO_ACCEPTCONN value after the execution of the accept or 1?
Socket option SO_ACCEPTCONN value after the execution of the accept or 1?

Time:10-12

I create a socket to listen a TCP connection, want to periodically check the socket is in the listening state, with the help of SO_ACCEPTCONN options, but found that seems to accept the connection after each time a return value of this option is zero, does this option after the execution of the accept the return value is not 1? Even in the case of listen for new connections,

In principle have a link to the new connection socket handle, this is not a listening socket is still in the listen state?

Probably steps:
1. Listen
2. Accept
3. Getsockopt (sfed_tcp_socket_fd, SOL_SOCKET, SO_ACCEPTCONN, & amp; Value, & amp; Len);

The third value to return a value of 0?
  • Related