Function SocketSend() Professional
Sends data to a connected socket.
Syntax
SocketSend( <nSocket> , ;
<cBuffer> , ;
[<nLength>], ;
[<nFlag>] , ;
[@<nError>] ) --> nBytesWritten
Parameters
<nSocket>
This is a numeric socket descriptor identifying a connected socket.
<cBuffer>
This is a character string holding the data to send.
<nLength>
Optionally, the number of bytes to send can be specified. This parameter defaults to Len(<cBuffer>).
<nFlag>
#define constants from the file SOCKET.CH are used for this parameter. It specifies the way in which the call is made.
Constants for sending data.
Constant | Description |
---|---|
MSG_NORMAL *) | Sends regular data |
MSG_DONTROUTE | Specifies that the data should not be subject to routing. |
MSG_OOB | Sends out-of-band data (SOCK_STREAM only) |
|
<nError>
If this parameter is passed by reference to the function, it gets assigned a numeric error code when the function fails. #define constants beginning with WSAE are available in the file SOCKET.CH to identify an error condition.
Return
The function returns the number of bytes written to socket, or 0 in case of an error.
Description
SocketSend() is used on connected datagram or stream sockets to write outgoing data on a socket. For datagram sockets, care must be taken not to exceed the maximum IP packet size of the underlying subnets. Excess data will be discarded.
Feedback
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.