completed a simple sockets API.