CInternetServer::Write Method  
 
INT Write(
  SOCKET hSocket,  
  LPBYTE lpBuffer,  
  INT cbBuffer  
);
INT Write(
  LPBYTE lpBuffer,  
  INT cbBuffer  
);

Send the contents of the specified buffer to to the client.

Parameters

hSocket
An optional parameter that specifies the handle to the client socket. If this parameter is omitted, the socket handle for the active client session will be used. If this method is called outside of a server event handler, the socket handle must be specified.
lpBuffer
The pointer to the buffer which contains the data that is to be sent to the client.
cbBuffer
The number of bytes to send from the specified buffer. This value must be greater than zero.

Return Value

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

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.

Requirements

Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header: Include cswsock10.h
Import Library: cswskv10.lib

See Also

IsReadable, IsWritable, Read, ReadLine, WriteLine