_UPNP_OpenPort Scol 5.x or above required
Opens a port on the Internet Gateway Device.
Prototype :
fun [S S I I I] I
- S : Name, like Application Name.
- S : IP address of the PC to which messages should be routed such as _hostIP.
- I : Port number (0-65535, ports categories: 0-1023:WellKnown, 1024-49151:Registered, 49152-65535:Dynamic&Private).
- I : Protocol, should be either UPNP_TCP or UPNP_UDP.
- I : Mode, should be either UPNP_SAFE or UPNP_FORCE. The second one will overwrite any existing similar port mapping (Port+Protocol).
Return : I Port number if successful, nil if it fails.
Error :
- EOK if no error.
- EARGNIL if the "Name" is nil.
- EADDRESS if the "Address" is nil.
- ERANGE if the port number is out of range.
- EFLAG if the protocole is incorrect.
- EARG if the mode is incorrect.
- ENET if an error occurs in the firewall.
- ECONN if the connection fails to the device.
- ENOFOUND if the connection is not initialized (see _UPNP_Connect).
- EPLATFORM if the current platform is not yet supported.
- EVM if a memory error occurs. The VM will exit and more informations
could be found in the log file (if activated in the debug mode level).
See also :
Example :
Note
Warning : this function is defined on MS Windows Scol version only !