Added the implementation for the socket interface.