netTCPStreamIP

Returns the IP address of the remote peer in a TCP connection. Takes a handle (Int). Returns the peer's IP in dotted notation, or empty string if invalid (String).

Network

Parameters & Returns

Parameters

handle Int

Returns

String

Quick Summary

Returns the IP address of the remote peer in a TCP connection. Takes a handle (Int). Returns the peer's IP in dotted notation, or empty string if invalid (String).

Technical Exegesis...

Retrieves the IP address of the connected peer (remote endpoint) for the specified TCP stream. Returns the IP in dotted notation (e.g., "192.168.1.100"), or an empty string if the handle is invalid or getpeername fails.

Uses getpeername to query the peer address and inet_ntoa to convert to string. For client connections (netOpenTCPStream), returns the server's IP. For accepted connections (netAcceptTCPStream), returns the client's IP. Useful for logging connections or implementing IP-based filtering.

Example

Example.bam
; No example implemented yet