Sockets
GetLocalHost
return the host name of the local endpoint of a socket connection
GetLocalPort
return the port number of the local endpoint of a socket connection
GetPeerHost
return the host name of the remote endpoint of a socket connection
GetPeerPort
return the port number of the remote endpoint of a socket connection
Calling Sequence
Parameters
Description
Examples
GetLocalHost(sid)
GetLocalPort(sid)
GetPeerHost(sid)
GetPeerPort(sid)
sid
-
valid socket ID for an open connection
These four procedures return information about the endpoints of a socket connection.
Each routine requires a single argument, which is a valid socket ID for an open connection. Either a string or a positive integer is returned, depending upon the type of information requested.
The procedure GetLocalHost returns the hostname of the local endpoint in a socket connection, while GetPeerHost returns the hostname of the peer side of the connection. In each case, the hostname is returned in the form of a string.
Port numbers for the local and remote endpoints are obtained as positive Maple integers by using the routines GetLocalPort and GetPeerPort, respectively.
withSockets:
sid≔Openmantis,echo
0
GetLocalHostsid
rdubtroll4.maplesoft.com
GetLocalPortsid
52730
GetPeerHostsid
mapletest.maplesoft.com
GetPeerPortsid
7
LookupServiceecho
Closesid
true
See Also
socket definition
Sockets[LookupService]
Download Help Document