Update socketEndpoint.py

Fixed arguments for socket.
Added encoding for sendstring communications.