This function creates a new socket and sets it to listen for new connections on the specified port. This command is basically a combination of the NEW TCP SOCKET(), LISTEN SOCKET() and BIND SOCKET() functions.
The PortNumber can be any number from 1 to 65535, although some of these ports may already be in use by other sockets and other processes.
The IpAddress is the numeric version of the IP Address of the network interface to listen on - if not provided, the command will listen on all interfaces.
The value returned is the Handle of the new socket for listening for new connections, or 0 if it was unable to create a socket for any reason. |