ServerPort Property  
 

Gets and sets the port number that will be used by the server to listen for connections.

Syntax

object.ServerPort [= port ]

Remarks

The ServerPort property is used to set the port number that server will use to listen for incoming client connections. Valid port numbers are in the range of 1 to 65535. It is recommended that most custom servers specify a port number larger than 5000 to avoid potential conflicts with standard Internet services and ephemeral ports used by client applications. The default port numbers used are port 80 for standard connections and port 443 for secure connections.

If a port number is specified that is already in use by another application, the OnError event will fire and the background server thread will terminate. Attempting to change the value of this property after the server has started will cause an exception to be raised. To change this property value, you must first call the Stop method which will terminate all active client connections.

Data Type

Integer (Int32)

See Also

ServerAddress Property, ServerName Property, Start Method