Reject Method  
 

Rejects a connection request from a remote host.

Syntax

object.Reject

Parameters

None.

Return Value

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

Remarks

The Reject method rejects a pending client connection and the remote host will see this as the connection being aborted. If there are no pending client connections at the time, this method will immediately return with an error indicating that the operation would cause the thread to block.

This method can only be used inside the OnAccept event, when the server accepts the pending client connection. If this method is called outside of an event handler, it will fail.

Rejecting a client connection can cause the client to terminate abnormally unless it is designed to handle aborted connection attempts. It is not recommended that you use this method unless you understand the implications of doing so. To gracefully terminate a client connection, use the Disconnect method.

See Also

Abort Method, Disconnect Method, Start Method, OnAccept Event