|const struct sockaddr TM_FAR * toAddressPtr,|
This function is used to send a zero copy message. It operates identically to sendto() with the exception that it takes a zero copy buffer handle as a parameter.
|Note:||Once tfZeroCopySendTo() is called, the caller does NOT own the buffer and it is freed by the TCP/IP stack, except when if fails with a TM_EWOULDBLOCK error code, in which case the user can either try and send the buffer at a later time, or free the zero copy buffer using tfFreeZeroCopyBuffer().|
- The socket descriptor to send data to.
- The zero copy buffer that contains the message.
- The length of the message to send.
- See below for possible flags parameters that can be OR'ed together.
- The address to send the packet to.
- The length of the destination address.
Value Meaning MSG_DONTWAIT Don't wait for data, but rather return immediately. MSG_DONTROUTE The SO_DONTROUTE optoin is turned on for the duration of this operation. Only diagnostic or routing progrms use it. MSG_SCATTERED Set this flag when sending a scattered zero copy recv buffer received with tfZeroCopyRecvFrom(). Note that to send a user scattered buffer (not obtained via a call to tfZeroCopyRecvFrom()) then tfSocketScatteredSendTo() can be used.
- >= 0
- The number of bytes sent.
|Note:|| TM_SOCKET_ERROR means that this socket call has failed and the errorCode has been set on the socket itself.
To retrieve the socket error the user must call tfGetSocketError(socketDescriptor).
Possible socket errors
- The socket descriptor is invalid.
- No route to destination.
- The socket received an ICMP destination unreachable message from the remote host. This typically means that the receiver is not listening on the remote port.
- The socket requires that the message be sent atomically and the message was too long.
- The TCP protocol requires usage of tfZeroCopySend() not tfZeroCopySendTo().
- The socket is marked as non-blocking and the operation would block.
- 'bufferHandle' does not correspond to a zero copy buffer.
- One of the following:
- bufferLength is less than or equal to 0.
- flags is something besides what is listed above.
- toAddressPtr is null.
- toAddressLength does not equal sizeof(struct sockaddr_in).