MINOR: sock: add sock_accept_conn() to test a listening socket

At several places we need to check if a socket is still valid and still
willing to accept connections. Instead of open-coding this, each time,
let's add a new function for this.
2 files changed