Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ipccontrol(2)

ipcselect(2)

IPCSEND(2)

Series 300 and 800 Only

NAME

ipcsend() − sends data on a virtual circuit connection

SYNOPSIS

#include <sys/ns_ipc.h>

void ipcsend (vcdesc,data,dlen,flags,opt,result);
ns_int_t vcdesc,dlen,*flags,*result;
char *data;
short int opt[];

DESCRIPTION

The ipcsend call is used to send data on an established connection.  The data may be sent as a single contiguous buffer or as a scattered data vector.  If the data is vectored, NetIPC will gather all the referenced data before sending it. 
 
flags parameter. 
 
For vectored writes an iovec structure contains the data vector. An iovec structure can be defined as:
 

struct iovec {
     char            *iov_base;
     unsigned        iov_len;
};

 
and the normal type for the data argument can be replaced by:

struct iovec *data;

Each iovec entry specifies the base address and length of an area in memory where data should be accessed.  ipcsend always fills-in one area completely before proceeding to the next area.  If the NSF_MORE_DATA bit (bit 26) of the flags parameter is set, the Transmission Control Protocol (TCP) may not immediately transmit the data indicated by the data parameter.  Instead, it may wait until it has received an amount of data that can be transmitted with the greatest efficiency.  Several transmissions of small amounts of data consume more than one large transmission.  If NSF_MORE_DATA is not set, TCP will attempt to transmit the data immediately, regardless of efficiency considerations.  If your process will be sending large amounts of data, HP recommends that you set NSF_MORE_DATA.  If NSF_MORE_DATA is set and you submit only a small amount of data (less than a few hundred bytes), then TCP may hold onto the data for a considerable period of time before transmitting it. 
 
ipcsend functions differently depending on whether the VC socket referenced is in synchronous or asynchronous mode.  The following paragraphs describe these differences:
 
Synchronous I/O. Send requests issued against VC sockets in synchronous mode may block. ipcsend will block if it can not immediately obtain the buffer space needed to accommodate the data.  The call will resume after the required buffer space becomes available, or if the synchronous timer expires.  Timeouts usually occur when the process on the receiving end of the connection stops receiving the data sent to it.  (The length of the synchronous time-out interval can be adjusted via ipccontrol.  Refer to the discussion of this call for more information.) 
 
Asynchronous I/O. Send requests issued against sockets in asynchronous mode will never block. If the buffer space needed to accommodate the data is not immediately available, a NSR_WOULD_BLOCK error (code 56) is returned. After receiving this error, the process can try the call again later, or determine when the socket is writeable by calling ipcselect.  (Refer to the discussion of this call for more information on writeable sockets.) 
 
This routine can be linked into a program by giving the -lnsipc option to cc(1) or ld(1). 

PARAMETERS

vcdesc (input parameter) VC socket descriptor.  Refers to the VC socket endpoint of the connection through which the data will be sent.  A VC socket descriptor can be obtained by calling ipcconnect and ipcrecvcn. 

data (input parameter) A buffer that will hold the data to be sent, or a data vector describing where the data to be sent is located. 

dlen (input parameter) If data is a data buffer, dlen is the length in bytes of the data in the buffer.  If data is a data vector, dlen is the length in bytes of the data vector. 

flags (input parameter) See below.  Refer to the NetIPC programmer’s manual for your system for a complete description of this parameter. 

opt (input parameter) An array of options and associated information.  See below.  Refer to the NetIPC programmer’s manual for your system for a complete description of this parameter. 

result (output parameter) The error code returned; zero or NSR_NO_ERROR if no error.  Refer to "Diagnostics" below for more information. 

FLAGS PARAMETER

NSF_MORE_DATA (bit 26)
(input parameter) When this bit is set, TCP may delay sending data.

NSF_VECTORED (bit 31)
(input parameter) Indicates that the data parameter refers to a data vector and not to a data buffer.

OPT PARAMETER

NSO_DATA_OFFSET
( optioncode = 8) ( datalength = 2) A two-byte integer that indicates a byte offset from the beginning of the data buffer where the data to be sent actually begins.  Only valid if the data parameter is a data buffer. 

RETURNS

None.  Errors are returned in the result parameter. 

AUTHOR

HP. 

SEE ALSO

ipccontrol(2), ipcselect(2). 

DIAGNOSTICS

[NSR_NO_ERROR] The call was successful. 

[NSR_xxxx] Refer to the errors listed in the NetIPC programmer’s manual for your system. 
 

Hewlett-Packard Company  —  May 11, 2021

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