SocketTools .NET Edition

NntpClient.Write Method (Byte[], Int32)

Write one or more bytes of data to the server.

[Visual Basic]
Overloads Public Function Write( _
   ByVal buffer As Byte(), _
   ByVal length As Integer _
) As Integer
[C#]
public int Write(
   byte[] buffer,
   int length
);

Parameters

buffer
A byte array that contains the data to be written to the server.
length
An integer value which specifies the maximum number of bytes of data to write. This value cannot be larger than the size of the buffer specified by the caller.

Return Value

An integer value which specifies the number of bytes actually written to the server. If an error occurs, a value of -1 is returned and the application should check the value of the LastError property to determine the cause of the failure.

Remarks

The Write method sends one or more bytes of data to the server. If there is enough room in the client's internal send buffer to accommodate all of the data, it is copied to the send buffer and control immediately returns to the caller. If amount of data exceeds the available buffer space and the client is in blocking mode, then the method will block until the data can be sent. If the client is in non-blocking mode and the send buffer is full, an error will occur.

See Also

NntpClient Class | SocketTools Namespace | NntpClient.Write Overload List