| |
| INT Write( |
| |
LPBYTE lpBuffer, |
|
| |
INT cbBuffer |
|
| ); |
| INT Write( |
| |
LPBYTE lpBuffer, |
|
| |
INT cbBuffer, |
|
| |
LPINTERNET_ADDRESS lpAddress, |
|
| |
UINT nRemotePort |
|
| ); |
The Write method sends the specified number of bytes to the
remote host.
Parameters
- lpBuffer
- The pointer to the buffer which contains the data that is to be
sent to the remote host.
- cbBuffer
- The number of bytes to send from the specified buffer. This
value must be greater than zero.
- lpAddress
- Pointer to an INTERNET_ADDRESS structure that
specifies the address of the remote host that is to receive the
data being written. For TCP stream sockets, this parameter must
always be NULL or specify the same address that was used to
establish the connection. For UDP datagram sockets, this may
specify any valid IP address.
- nRemotePort
- The port number of the remote host that is to receive the data
being written. For TCP stream sockets, this value must always be
zero, or specify the same port number that was used to establish
the connection. For UDP datagram sockets, this may specify any
valid port number.
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
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 sockets, 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: Include cswsock10.h
Import Library: cswskv10.lib
Unicode: Implemented as Unicode and ANSI versions.
See Also
EnableEvents,
IsBlocking,
IsReadable,
IsWritable, Read,
ReadLine,
RegisterEvent,
WriteLine
|
|