Support read and write from blocking and non-blocking pipes and sockets
authorChristopher Dykes <cdykes@fb.com>
Tue, 9 Aug 2016 23:58:56 +0000 (16:58 -0700)
committerFacebook Github Bot 3 <facebook-github-bot-3-bot@fb.com>
Wed, 10 Aug 2016 00:08:32 +0000 (17:08 -0700)
commit60136d876fd415a26519a95a026d02251e249254
treec52ac48c1ce9fad3886a9d08f2a65dc6ef6d439c
parentcc01a8a4915f51a62771f958162a5489af090748
Support read and write from blocking and non-blocking pipes and sockets

Summary: Also switch `pipe` to return a socket pair instead, as libevent can't poll against a pipe on Windows. And lastly, fix the file descriptor for sockets leaking when close is called.

Reviewed By: yfeldblum

Differential Revision: D3691255

fbshipit-source-id: c684242d255ac5158a4c805d432d345dac1b3bd8
folly/portability/Unistd.cpp
folly/portability/Unistd.h