Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ send(2dn) — Ultrix DECnet 3.0 VAX

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

read(2dn)

recv(2dn)

write(2dn)

send(2dn)

NAME

send − send normal data and out-of-band messages

SYNTAX

#include <sys/types.h>
#include <sys/socket.h>

cc = send (s,msg,msglen,flags)
int cc,s;
char *msg;
int msglen, flags;

ARGUMENTS

Input Arguments

s Specifies a descriptor for a socket that has been returned by the socket call.

msg Specifies the address of the buffer that contains the outgoing message. 

msglen Specifies the size of the message. 

flags Set to MSG_OOB, which sends an out-of-band message. 

Return Argument

cc Number of characters sent. 

DESCRIPTION

The send call is used to transmit normal or out-of-band data to another program. It can be used only when a socket is in a connected state.  For further information, see connect(2dn).

Use the send call instead of write when you want to specify the MSG_OOB flags argument to indicate that an out-of-band message will be sent to the destination program.  Out-of-band messages are sent to a receiving program ahead of normal data messages.  Out-of-band messages are sent and received as DECnet NSP interrupt messages and can be from 1- to 16-bytes in length.  The signal SIGURG indicates the arrival of out-of-band data. 

The number of characters sent is returned in cc.  If no message space is available at the receiving socket to hold the message being transmitted, the send call most likely will block.  If the socket is set in nonblocking I/O mode, the send returns in error with errno set to EWOULDBLOCK.

You can use the select call to determine when it is possible to send more normal data.

RETURN VALUE

If the call succeeds, the number of characters sent are returned and if an error occurs, a value of −1 is returned. Additional error detail will be specified in the external variable errno. 

DIAGNOSTICS

[EBADF] The s argument is not a valid descriptor. 

[EFAULT] An invalid user address space was specified for an argument. 

[EMSGSIZE] The socket requires that the message be sent automatically, but the size of the message made this impossible.  Note that zero-length messages are illegal. 

[EWOULDBLOCK] The socket is marked nonblocking and the send operation would have blocked.

SEE ALSO

read(2dn), recv(2dn), write(2dn)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026