| BOOL Flush( |
| |
SOCKET hSocket |
|
| ); |
Flush the send and receive buffers for the specified client
session.
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 Flush method will flush any data waiting to be read or
written to the remote host . It is important to note that this method
is not similar to flushing data to a disk file; it does not ensure
that a specific block of data has been written to the socket. For
example, you should never call this function immediately after
calling the Write method or prior to calling the
Disconnect method.
An application never needs to use the Flush method under
normal circumstances. This method is only to be used when the
application needs to immediately return the socket to an inactive
state with no pending data to be read or written. Calling this
function may result in data loss and should only be used if you
understand the implications of discarding any data which has been
sent by the client.
Requirements
Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cswsock12.h
Import Library: cswskv12.lib
See Also
|