SocketTools .NET Edition

InternetServer.Flush Method (Int32)

Flush the contents of the send and receive buffers for the client socket.

[Visual Basic]
Overloads Public Function Flush( _
   ByVal handle As Integer _
) As Boolean
[C#]
public bool Flush(
   int handle
);

Parameters

handle
An integer value which specifies the handle to the client session.

Return Value

A boolean value which specifies if the client buffers have been flushed.

Remarks

The Flush method will flush any data waiting to be read or written for the specified client session. 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 client. For example, you should never call this function immediately after calling the Write or WriteLine methods, or prior to calling the Disconnect method.

An server should never use the Flush method under normal circumstances. This method is only to be used when the server needs to immediately return the client to an inactive state with no pending data to be read or written. Calling this method 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.

See Also

InternetServer Class | SocketTools Namespace | InternetServer.Flush Overload List | Abort Method | Disconnect Method | Flush Method