SocketTools .NET Edition

InternetServer.Write Method (Int32, String)

Write a string of characters to a client.

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

Parameters

handle
An integer value which specifies the handle to the client session.
buffer
A string which contains the data to be written to the client.

Return Value

An integer value which specifies the number of characters actually written to the client. 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 a client. If there is enough room in the socket'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 the method will block the current thread until the data can be sent.

See Also