Adjust the AsyncSocket TestServer to work with Winsock
authorChristopher Dykes <cdykes@fb.com>
Thu, 11 Aug 2016 21:26:41 +0000 (14:26 -0700)
committerFacebook Github Bot 7 <facebook-github-bot-7-bot@fb.com>
Thu, 11 Aug 2016 21:39:04 +0000 (14:39 -0700)
commit66c56cb835dc4d9a5a0fecfd9212635a910d7a58
tree0b7ec327bcde41e7b341234284d6b1f0eeddd62c
parent4027e2c635201333dee0ebf92d51b62422c4a57e
Adjust the AsyncSocket TestServer to work with Winsock

Summary:
Winsock doesn't let you listen to a socket if it hasn't been bound to anything, so bind it to the port first.
TestServer was also never closing the file descriptor, causing the socket to leak.

Reviewed By: yfeldblum

Differential Revision: D3698467

fbshipit-source-id: cca415143009fbee99ebf94d7f46aedc9c59191d
folly/io/async/test/AsyncSocketTest.h