CInternetServer::Abort Method  
 
BOOL Abort(
  SOCKET hSocket  
);
BOOL Abort();

Immediately close the socket without waiting for any remaining data to be written out.

Parameters

hSocket
An optional parameter that specifies the handle to the client socket. If this parameter is omitted, the socket handle for the active client session will be used. If this method is called outside of a server event handler, the socket handle must be specified.

Return Value

If the method succeeds, the return value is non-zero. If the method fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The Abort method should only be used when the connection must be closed immediately. This method should only be used to abort client connections and should not be called within an OnAccept event handler. To reject an incoming client connection, use the Reject method.

In most cases, the server should call the Disconnect method to gracefully close a client connection. Aborting the connection will discard any buffered data and may cause errors or result in unpredictable behavior by the client application.

Requirements

Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header: Include cswsock10.h
Import Library: cswskv10.lib

See Also

Cancel, Disconnect, Reject