Name
GetLocalPort -- get port number of local side (V5.0)
Synopsis
port = GetLocalPort(id[, type])
Function
This command returns the port number on the local side of the network object specified in id. 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 local port of a connection obtained by a call to the OpenConnection(), function or the local port of a client connection obtained by listening to the OnConnect and OnReceiveData events using the command InstallEventHandler().

#NETWORKSERVER:
Query the local port of a server established using the CreateServer() call.

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

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

Inputs
id
network object to query
type
optional: type of the network object passed in argument 1 (defaults to #NETWORKCONNECTION)
Results
port
port number of the local side of the connection

Show TOC