Don't attempt to call getsockname before binding an async socket
authorChristopher Dykes <cdykes@fb.com>
Wed, 10 Aug 2016 20:15:18 +0000 (13:15 -0700)
committerFacebook Github Bot 0 <facebook-github-bot-0-bot@fb.com>
Wed, 10 Aug 2016 20:23:31 +0000 (13:23 -0700)
commit76a4de976ad66df26aedd949a2c62e19d88ceb30
treed0639560cda3ba2d2db01068f19922e52d9090aa
parentc326c636c394b6b8c2ea170bafb89e7a00d8e828
Don't attempt to call getsockname before binding an async socket

Summary: With WinSock, calling `getsockname` on a socket before it's been bound will always result in an error, so make sure to bind the socket first.

Reviewed By: yfeldblum

Differential Revision: D3698112

fbshipit-source-id: e9efe05323b242add3808ee1a6fec2593beb04ac
folly/io/async/AsyncServerSocket.cpp