This routine will be called in the mode of the caller. (No mechanism is
provided for the routine to be called at a different mode).
Advanced access control is provided by ICC Security objects. For
information about ICC system management and security, see the
HP OpenVMS System Manager's Manual.
This service declares an application association with ICC. Servers must
make this call to declare or register their name and to indicate their
readiness to receive incoming connections. Although a client is
permitted to call this routine, it is unnecessary for simple
applications. A client application that wishes to be notified of
disconnection events or Receive Data events must call the
$ICC_OPEN_ASSOC service.
A client can open a connection without specifying an open association;
this automatically creates a default association name of
ICC$PID_nnnnnnnn (where nnnnnnnn is a character representation of the
Process ID).
NETMBX privilege is required to open any association.
The association name space is a controlled resource. For information
about managing this resource, see the HP OpenVMS System Manager's Manual.
An attempt to open an association with a name not authorized as
described in the HP OpenVMS System Manager's Manual will fail with the error SS$_NOPRIV
returned to the caller. In addition to making entries in the system's
local association name space, a call to $ICC_OPEN_ASSOC may also make
an entry in a simple clusterwide registry of active associations.
An association may only be accessed from the mode in which it was
opened. Inner modes are prevented from using the default association.
An application can open any number of associations subject to available
process BYTLM quota. Currently, there is a systemwide limit of 512 open
associations. There is no limit imposed clusterwide.
Description of User-Supplied Routines (ASTs)
When opening an association, the user may optionally supply a
connect/disconnect AST and/or a Data Event AST. These routines will be
used for all connections established over the specified association. In
addition, for any of the asynchronous services (those provided with
both an immediate return and a "W" form), a completion AST may be
supplied by the user. This section describes these ASTs.
1. Connect and Disconnect AST
The user chooses the name of this routine and supplies the procedure
name as an argument to the Open Association service. Seven arguments
will be passed to the user.
The first argument notifies the user whether this is an incoming new
connection or a disconnection of an existing connection. The second
identifies the connection. The third and fourth provide access to
incoming connect or disconnect data (if any) sent by the cooperating
application. The fifth argument provides the number of bytes available
for any optional Accept or Reject data (in the case of a connect
request) or the disconnect reason supplied by the cooperating
application (if any).
For connect events, the sixth and seventh arguments are the EPID and
user name of the process requesting the connect, respectively.
The user has the choice of using and declaring a common routine or
separate routines as specified when calling $OPEN_ASSOCIATION.
Format
ConnDiscRtn event_type ,conn_handle ,data_len ,data_bfr ,P5 ,P6 ,P7
|
C Prototype
void ConDiscRtn (unsigned int event_type, unsigned int conn_handle,
unsigned int data_len, char *data_bfr,
unsigned int P5, unsigned int P6, char *P7);
|
Arguments
event_type
Type: longword (unsigned)
Access: read only
Mechanism: by value
|
This field will contain a code describing the type of event. The
possible event codes are defined in ICCDEF:
ICC$C_EV_CONNECT - Connection event
ICC$C_EV_DISCONNECT - Disconnection event
|
conn_handle
Type: longword (unsigned)
Access: read only
Mechanism: by value
|
The handle of the connection associated with the event.
data_len
Type: longword (unsigned)
Access: read only
Mechanism: by value
|
The length (in bytes) of the incoming data. This value specifies the
length of the buffer data_bfr, and will be between 0
and 1000, with zero indicating no data.
data_bfr
Type: character-coded text string
Access: read only
Mechanism: by 32-bit or 64-bit value (Alpha and Integrity servers)
|
The 32-bit address of the P1-space buffer containing the data, or zero
if no data is available. The length of this buffer is specified by the
argument data_len.
Upon return from the AST, the address of the data is no longer valid.
An application wishing to reference the Connection or Disconnection
data after Return must copy the data from the supplied buffer to
storage owned by the application.
P5
Type: longword (unsigned)
Access: read only
Mechanism: by value
|
The usage of this argument is dependent on the specified event type
code (event_type).
For connect events (event_type=ICC$C_EV_CONNECT), this
argument contains the length (in bytes) of the buffer available for a
reply.
For disconnect events
(event_type=ICC$C_EV_DISCONNECT), this argument
contains the user-defined disconnect reason/status from the remote
partner.
P6
Type: quadword (Alpha and Integrity servers
Access: read only
Mechanism: by value
|
The usage of this argument is dependent on the specified event type
code (event_type).
For connect events (event_type=ICC$C_EV_CONNECT), this
argument contains the EPID of the process requesting the connection,
passed by value.
For disconnect events
(event_type=ICC$C_EV_DISCONNECT), this argument
contains the user-defined user_context supplied when
the connection was opened. For a client, the
user_context is that supplied to the $ICC_CONNECT
call. For a server, it is the value supplied to $ICC_ACCEPT.
P7
Type: character-coded text string
Access: read only
Mechanism: by reference
|
For connect events: Username, passed by reference (to P1 space buffer)
as a 12-character, space-filled string.
The application must copy this information to local storage before
exiting from the connect routine.
For disconnect events, this argument is zero (0).
2. Data Event Routine
This routine, if supplied by the user when opening the association,
allows the user to be notified of any pending data events over any
connections subsequently opened over that association.
If the user has supplied this routine, the Receive service must only be
called in response to incoming data events signaled by this routine,
and must be called with a buffer large enough to handle the message
size specified.
Use of this routine obligates the user to allocate buffers up to the
size requested by the cooperating application. The only recovery
provided at this time if a sufficiently large buffer cannot be
allocated is to disconnect the connection. Failure to issue a receive
call or disconnect may stall all further communication on this
connection.
Format
DataEventRtn message_size ,conn_handle ,user_context
|
C Prototype
void DataEventRtn (unsigned int message_size, unsigned int conn_handle,
unsigned int user_context);
|
Arguments
message_size
Type: longword (unsigned)
Access: read only
Mechanism: by value
|
This field will contain the number of bytes in the pending data event.
conn_handle
Type: longword (unsigned)
Access: read only
Mechanism: by value
|
The handle of the connection associated with the event. This value
should be used as the conn_handle argument to
$ICC_RECEIVE.
user_context
Type: quadword (Alpha and Integrity servers
Access: read only
Mechanism: by value
|
The user-defined user_context supplied when the
connection was opened. For a client, the user context is that supplied
to the $ICC_CONNECT call. For a server, it is the value supplied to
$ICC_ACCEPT.
3. Completion ASTs
Completion ASTs may be supplied to the $ICC_CONNECT[W],
$ICC_DISCONNECT[W], $ICC_TRANSMIT[W], $ICC_RECEIVE[W],
$ICC_TRANSCEIVE[W], and $ICC_REPLY[W] services. In all cases, they are
called at the completion of the requested operation, with the single
argument, the AST parameter supplied when the original service was
called, passed by value.
Completion ASTs are not called if the service returns an error prior to
initiating the operation. $ICC_CONNECT and $ICC_ACCEPT accept the flag
ICC$V_SYNCH_MODE which indicates that the routines $ICC_TRANSMIT[W],
$ICC_RECEIVE[W], and $ICC_REPLY[W] are permitted to return the status
SS$_SYNCH, which will indicate that completion has already occurred and
the AST will not be called.
Required Access or Privileges
For more information, see the HP OpenVMS System Manager's Manual.
Required Quota
BYTCNT, BYTLM
Related Services
$ICC_ACCEPT, $ICC_CLOSE_ASSOC, $ICC_CONNECT, $ICC_CONNECTW,
$ICC_DISCONNECT, $ICC_DISCONNECTW, $ICC_RECEIVE, $ICC_RECEIVEW,
$ICC_REJECT, $ICC_REPLY, $ICC_REPLYW, $ICC_TRANSCEIVE,
$ICC_TRANSCEIVEW, $ICC_TRANSMIT, $ICC_TRANSMITW
SS$_NORMAL, SS$_EXQUOTA, SS$_INSFMEM, SS$_LINKDISCON, SS$_BUFOVL,
SS$_ACCVIO