Properly support socketpair and reading and writing non-blocking sockets
authorChristopher Dykes <cdykes@fb.com>
Tue, 9 Aug 2016 23:44:11 +0000 (16:44 -0700)
committerFacebook Github Bot 8 <facebook-github-bot-8-bot@fb.com>
Tue, 9 Aug 2016 23:53:30 +0000 (16:53 -0700)
commit4a0d0c51faec44f4a2d4e788cb9fce4230fa411a
tree33965627673eb47365da46ae3ae9de53940417c0
parent5d8ca09a3f96afefb44e35808f03651a096ab9c7
Properly support socketpair and reading and writing non-blocking sockets

Summary:
Also handle invalid file descriptors correctly and switch away from `WSASendMsg` for the implementation of `sendmsg` due to limitations imposed by WinSock.
This also fixes up a few places that were explicitly referencing the global version of some socket functions, which was bypassing the socket portability layer.

Reviewed By: yfeldblum

Differential Revision: D3692358

fbshipit-source-id: 05f394dcc9bac0591df7581345071ba2501b7695
folly/io/async/AsyncSocket.cpp
folly/io/async/test/AsyncSocketTest.h
folly/io/async/test/AsyncSocketTest2.cpp
folly/portability/Sockets.cpp
folly/portability/Sockets.h