Function TCP_RemotePort(socket)
Returns the port the socket is connecting on