.targetport Property


For active opens on the currently selected socket (selection is made through sock.num), specifies the target port to which the socket will attempt to connect. For passive opens, specifies, in certain cases, the only port from which an incoming connection will be accepted.



Value Range:

0-65535, default = 0

See Also:

sock.targetip, sock.remoteip


For active opens, this property is only relevant at the moment of connection establishment.

For incoming connections, whether this property will matter or not is defined by the sock.inconmode property. When sock.inconmode = 1 — PL_SOCK_INCONMODE_SPECIFIC_IPPORT, an incoming connection will only be accepted from the port matching the one set in the sock.targetport property.

The current port on the "other side" of the connection can always be checked through the sock.remoteport read-only property.

.targetport Property