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.

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. To enable a server to be stopped and immediately restarted using the same address and port number, make sure that the ReuseAddress property is set to a value of True.

Data Type

Integer (Int32)

See Also

ReuseAddress Property, ServerAddress Property, ServerName Property, Start Method