Implement more of the sockets API