Factor out the guts of get_peeraddr_string.
Add get_localaddr_string.
Use get_localaddr_string in the connect bind log message.

This includes the port number, not just the address.
Add a debug message when binding a socket.