Name
GetConnectionPort -- get port number of remote side (V5.0)
Synopsis
port = GetConnectionPort(id[, type])
Function
This command returns the port number of the connection object specified in id. This can either be the identifier of a server connection obtained by a call to OpenConnection(), the identifier of a client connection obtained by listening to the OnConnect and OnReceiveData events using InstallEventHandler(), or it can be the identifier of a UDP object created by CreateUDPObject().

The optional argument type specifies the type of the network object passed in argument 1. The following types are currently supported by this function:

#NETWORKCONNECTION:
Query the port of a connection obtained by a call to OpenConnection(), or the IP of a client connection obtained by listening to the OnConnect and OnReceiveData events that can be installed using the command InstallEventHandler().

#NETWORKUDP:
Query the port of a UDP object created using the CreateUDPObject() call.

If you omit the optional type argument, it will default to type #NETWORKCONNECTION.

Inputs
id
connection object to query
type
optional: type of network object to query (defaults to #NETWORKCONNECTION) (V8.0)
Results
port
port number of the remote side of the connection
Example
See GetConnectionIP


Show TOC