IP$ = TCPGetAddr$(connection)
This function returns the host name and IP address of the remote device you are connected with as a delimited string. The delimiter character is a slash "/". If the specified TCP socket is not open and connected an empty string is returned.
addr$ = TCPGetAddr$(1)