world.UdpPortList

MUSHclient script function (Method) — introduced in version 3.60

Returns an array of all the UDP ports in use by this world

Prototype

VARIANT UdpPortList();

Data type meanings

Description

Returns a variant array of all the UDP ports that are being listened to by plugins for this world. eg.

4223
4224

VBscript example

dim portList

portList= world.UdpPortList

If Not IsEmpty (portList) Then
  
  For Each v In portList
    world.note v 
  Next

End If

Lua example

-- show all ports

for _, v in pairs (UdpPortList()) do 
  Note (v) 
end

Return value

If there are no ports in use then the return value is empty. Use "IsEmpty" to test for this possibility.

Otherwise, it returns a variant array containing the port numbers in use.

Use "lbound" and "ubound" to find the bounds of the array of variables (ie. the number of ports in the list).

Related topic

Information

See also

FunctionDescription
GetUdpPortFind a free port for UDP listening
UdpListenListens for incoming packets using the UDP protocol
UdpSendSends a packet over the network using the UDP protocol