SocketTools .NET Edition

NntpClient.Write Method (String, Int32)

Write a string of characters to the server.

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

Parameters

buffer
A string which contains the data to be written to the server.
length
An integer value which specifies the maximum number of characters to write. This value cannot be larger than the length of the string specified by the caller.

Return Value

An integer value which specifies the number of characters 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 a string of characters 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