fixing the overloaded sendData function in socket.cpp