return the host name of the local endpoint of a socket connection - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Connectivity : Web Features : Network Communication : Sockets Package : Sockets/GetLocalHost

Sockets[GetLocalHost] - return the host name of the local endpoint of a socket connection

Sockets[GetLocalPort] - return the port number of the local endpoint of a socket connection

Sockets[GetPeerHost] - return the host name of the remote endpoint of a socket connection

Sockets[GetPeerPort] - return the port number of the remote endpoint of a socket connection

Calling Sequence

GetLocalHost(sid)

GetLocalPort(sid)

GetPeerHost(sid)

GetPeerPort(sid)

Parameters

sid

-

valid socket ID for an open connection

Description

• 

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.

Examples

withSockets:

sid:=Openmantis,echo

0

(1)

GetLocalHostsid

rdgetroll1.maplesoft.com

(2)

GetLocalPortsid

58785

(3)

GetPeerHostsid

rdgeodin.maplesoft.com

(4)

GetPeerPortsid

7

(5)

LookupServiceecho

7

(6)

Closesid

true

(7)

See Also

socket definition, Sockets, Sockets[LookupService]


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam