Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ipcrecvcn(2) — HP-UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ipcconnect(2)

ipccontrol(2)

ipcselect(2)

ipcsend(2)

ipcrecv(2)

IPCRECVCN(2)

Series 300 and 800 Only

NAME

ipcrecvn() - receives a connection request on a call socket

SYNOPSIS

#include <sys/ns_ipc.h>

void ipcrecvcn (calldesc,vcdesc,flags,opt,result);
ns_int_t calldesc,*vcdesc,*flags,*result;
short int opt[];

DESCRIPTION

Compared to the telephone system, ipcrecvcn is analogous to answering a telephone because processes must call ipcrecvcn to receive connection requests.  Consider the following example:  Process A calls ipcconnect with a destination descriptor that refers to a the location of a call socket owned by Process B.  This causes Process B’s "telephone" (call socket) to "ring" (receive a connection request).  In order to answer its "telephone," Process B calls ipcrecvcn.  A process’s call socket (or "telephone") is considered to be "ringing" when it has one or more queued connection requests.  Process A must still call ipcrecv to determine whether the connection was successfully established (i.e., whether Process B "answered its telephone"). 
 
When ipcrecvcn is invoked successfully against a call socket that has queued connection requests, it returns a VC socket descriptor to the calling process.  This VC socket descriptor can be used to specify the virtual circuit connection a process intends to send on, receive on, or shut down with subsequent NetIPC calls. 
 
ipcrecvcn functions differently depending on whether the call socket referenced is in synchronous or asynchronous mode.  (When a socket is created, it is placed in synchronous mode by default.  You can place a socket in asynchronous mode by calling ipccontrol.  Refer to ipccontrol for more information.)  The following paragraphs describe these differences:
 
Synchronous I/O. ipcrecvcn will block when invoked against a call socket that has no queued connection requests if the socket is in synchronous mode.  The calling process will resume execution when a connection request arrives, or after the synchronous time-out interval has expired.  ipcrecvcn calls will not block indefinitely against a given call socket unless the referenced socket’s synchronous time-out interval has been set to infinity via a call to ipccontrol. 
 
Asynchronous I/O. ipcrecvcn will never block against sockets in asynchronous mode.  When ipcrecvcn is invoked against an asynchronous call socket that has no queued connection requests, a NSR_WOULD_BLOCK (code 56) is returned to the calling process.  When ipcrecvcn is used in this way, the calling process does not wait to receive a connection request.  In order to determine when connection requests are present, a process can perform an exception select on the referenced call socket by calling ipcselect.  (Refer to the discussion of ipcselect for more information.) 
 
When a process calls ipcrecvcn, TCP checksumming for the connection that will be established is automatically enabled.  TCP checksum is performed in addition to data link checksum. 
 
This routine can be linked into a program by giving the -lnsipc option to cc(1) or ld(1). 

PARAMETERS

calldesc (input parameter) Socket descriptor.  Refers to a call socket owned by the calling process. 

vcdesc (output parameter) VC socket descriptor.  Refers to a VC socket that is the endpoint of the newly-established virtual circuit connection. 

flags (input parameter) No flags are defined for this call.  All flags parameter bits must be cleared (set to 0).  Refer to the NetIPC programmer’s manual for your system for a complete description of this parameter. 

opt (input parameter) 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. 

OPT PARAMETER

NSO_MAX_SEND_SIZE
( optioncode = 3) ( datalength = 2) A two-byte integer that specifies the maximum number of bytes you expect to send with a single call to ipcsend on this connection.  Default: TCP default is 100 bytes.  If this option is not specified, ipcsend will return an error if a call attempts to send greater than 100 bytes. 

NSO_MAX_RECV_SIZE
( optioncode = 4) ( datalength = 2) A two-byte integer that specifies the maximum number of bytes you expect to receive with a single call to ipcrecv on this connection.  Default: TCP default is 100 bytes.  If this option is not specified, ipcrecv will return an error if a call attempts to receive greater than 100 bytes. 

RETURNS

None.  Errors are returned in the result parameter. 

AUTHOR

HP. 

SEE ALSO

ipcconnect(2), ipccontrol(2), ipcselect(2), ipcsend(2), ipcrecv(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