Start of tcpsocket implementation.