IP address

Blitz3D Forums/Blitz3D Programming/IP address

1. Looked in the documentation and seems these two lines are what you're after:

strStream=AcceptTCPStream(svrGame)
intIP=TCPStreamIP( strStream )

2. Local IP's

; Display all local user IP's
;
Print "Local IPs:"
For i=1 To CountHostIPs(GetEnv("localhost"))
Print DottedIP(HostIP(i))
Next

3. Read the documentation and check the code archives next time.

TCPStreamIP( tcp_stream )
Parameters
tcp_stream - TCP stream handle

Description
Returns the integer IP address of the specified tcp_stream. The address returned is always that of the client machine.

RecvUDPMsg( udp_stream )
Parameters
udp_stream - UDP stream handle

Description
Receives a UDP message into the specified UDP stream. Standard stream read commands can then be used to examine the message.

The return value is the integer IP address of the message source, or 0 if no message was available. You can use UDPMsgPort() to find out the port number of the message source.