How about calling socket.close() as well? So the socket gives up?