Stop Method

Stop listening for new client connections and terminate all active clients already connected to the server.

Syntax

object.Stop

Remarks

The Stop method instructs the server to stop accepting client connections, disconnects all active client connections and terminates the thread that is managing the server session.

After the server has been terminated, the closed listening socket will go into a TIME-WAIT state which prevents an application from reusing the same address and port number bound to that socket for a brief period of time, typically two to four minutes. This is normal behavior designed to prevent delayed or misrouted packets of data from being read by a subsequent connection. To immediately start a new server using the same local address and port number, set the ReuseAddress property to a value of True.

Return Value

A value of zero is returned if the operation was successful, otherwise a non-zero error code is returned which indicates the cause of the failure.

See Also

ReuseAddress Property, State Property, Restart Method, Resume Method, Start Method, Suspend Method


Copyright © 2010 Catalyst Development Corporation. All rights reserved.