I am reading and writing to TCP socket via a duplex handle h.
In the client:
sock <- socket (addrFamily addr) (addrSocketType addr) (addrProtocol addr)