Flush Method  
 

Flush the contents of the send and receive socket buffers.

Syntax

object.Flush

Parameters

None.

Return Value

A value of zero is returned if the control buffers were flushed successfully. Otherwise, a non-zero error code is returned which indicates the cause of the failure.

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 remote host.

See Also

IsReadable Property, IsWritable Property, Read Method, Write Method