More useful logging upon failed AsyncServerSocket::bind()
authorMarcelo Juchem <marcelo.juchem@fb.com>
Tue, 3 May 2016 22:35:30 +0000 (15:35 -0700)
committerFacebook Github Bot 8 <facebook-github-bot-8-bot@fb.com>
Tue, 3 May 2016 22:50:22 +0000 (15:50 -0700)
commit0d8402e0320e90b87d312967ff039c19417ca4f1
tree1cb18680cebdc6d25c6dfbe3940f7dac197f8967
parent32623e8e6c4f28c2d7c10e813b97bed063686c1f
More useful logging upon failed AsyncServerSocket::bind()

Summary: `AsyncServerSocket::bind()` would not give information like port or family name when failing to bind a socket. This diff addresses that by including this information in the exception. Two additional helper methods were added to `SocketAddress` to retrieve both the port and the family name from a `sockaddr` structure.

Reviewed By: ckwalsh, yfeldblum

Differential Revision: D3249778

fb-gh-sync-id: 4edb28af5c211b7bf8d525b40844a5b0b6261e07
fbshipit-source-id: 4edb28af5c211b7bf8d525b40844a5b0b6261e07
folly/SocketAddress.cpp
folly/SocketAddress.h
folly/io/async/AsyncServerSocket.cpp
folly/io/async/test/AsyncSocketTest.cpp