Expose enough functions in tcp_socket and tcp_server to allow listening and originating connections on the same port.  So far, this seems to work on win32, other platforms untested.
Add a local_endpoint() function so we can find out which local interface a socket is bound to
constification