world.UdpPortList
Returns an array of all the UDP ports in use by this world
Prototype
VARIANT UdpPortList();
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
See also
| Function | Description |
|---|---|
| GetUdpPort | Find a free port for UDP listening |
| UdpListen | Listens for incoming packets using the UDP protocol |
| UdpSend | Sends a packet over the network using the UDP protocol |