Method NetUtils.port_of()
- Method
port_of
stringport_of(RemoteAddressObject|string|int(0)inc,bool|voidlocal_address,string|voiddef)- Description
Similar to ip_of but instead of IP returns port number.
If the argument is an object with a
query_addressmethod, return the port# part of the string returned by calling that function withlocal_addressas the argument.This means that for Stdio.File objects the remote address is returned by default, but if
local_addressis true the local address is returned.If the argument is a string instead, the part of the string after the first space is returned.
If the argument is 0 the default
defvalue is returned, UNDEFINED unless specified.If
defis supplied, it is used both when query_address() fails or something that is not a file descriptor object or a string is passed as the argument to this function.