INtime SDK Help
send, sendto (legacy networking)
INtime Help

The send() and sendto() functions send a message from one socket to another. send() may be used only when the socket is in a connected state, while sendto() may be used at any time.

int send(
    int s, 
    char* buf,
    int len,
    int flags
);

int sendto(
    int s,
    char* buf,
    int len,
    int flags,
    struct sockaddr to,
    int tolen
);

Parameters

s
The local socket.
buf
Points to the buffer holding the message to be sent.
len
The length of the message in bytes, for send() and sendto().
flags
0. No special handling.
to
The address of the target socket.
tolen
The length in bytes of the to argument.

Remarks

No indication of failure to deliver is implicit in a send. Return values of -1 indicate some locally detected errors.

Return Values

The number of characters sent.
Success.
-1 and the function sets errno to one of these values:
EBADF Invalid file descriptor or file not opened for writing.
ENOSPC No space left on device.
Failure.

Requirements

Versions Defined in Include Link to
INtime 3.0 intime/rt/include/sys/socket.h sys/types.h
sys/socket.h
netiff3m.lib
   
See Also