Update socket.cpp