Added stuff to socket.py.