CNntpClient::Write Method  
 
INT Write(
  LPBYTE lpBuffer,  
  INT cbBuffer  
);
INT Write(
  LPCTSTR lpszBuffer  
  INT cbBuffer  
);

The Write method sends the specified number of bytes to the server.

Parameters

lpBuffer
The pointer to the buffer which contains the data that is to be sent to the server. In an alternate form of the method, the pointer is to a string.
cbBuffer
The number of bytes to send from the specified buffer. This value must be greater than zero, unless a pointer to a string buffer is passed as the parameter. In that case, if the value is -1, all of the characters in the string, up to but not including the terminating null character, will be sent to the server.

Return Value

If the method succeeds, the return value is the number of bytes actually written. If the method fails, the return value is NNTP_ERROR. To get extended error information, call GetLastError.

Remarks

The return value may be less than the number of bytes specified by the cbBuffer parameter. In this case, the data has been partially written and it is the responsibility of the client application to send the remaining data at some later point. For non-blocking clients, the client must wait for the next asynchronous notification message before it resumes sending data.

Requirements

Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header File: cstools10.h
Import Library: csnwsv10.lib
Unicode: Implemented as Unicode and ANSI versions.

See Also

EnableEvents, IsBlocking, IsReadable, IsWritable, Read, RegisterEvent