|
|
|
Removes a connection to a port opened by a call to AIFPORTOPEN.
Syntax
REC I32 I32
AIFPORTCLOSE ( overall_status, port_id, access_mode );
Parameters
- overall_status
- record by reference (required)
Returns the overall status of the call. A zero indicates a successful
call. A negative value indicates an error in the overall call. A
positive value indicates a warning. Refer to appendix A for meanings of
status values.
Record type: status_type (Refer to appendix B.)
- port_id
- 32-bit signed integer by reference (required)
The port ID of the port to close (the identifier returned from a
successful call to AIFPORTOPEN).
- access_mode
- 32-bit signed integer by value (optional)
Individual access modes may be closed separately. This parameter specifies
the mode to close with this call to AIFPORTCLOSE. The access need
not be the same as used in the AIFPORTOPEN. If the calling
process does not have the port open for the specified access, the close is
ignored for that access. If not passed, the port is closed for all access
modes. Values and their meanings are as follows:
| 1 | Receive access |
| 2 | Send access |
| 3 | Both receive and send access |
Default: all access modes
Operation Notes
For every AIFPORTOPEN performed during the life of a process, a
corresponding AIFPORTCLOSE should be performed. In the event of a
process abort, or if the process neglects to call AIFPORTCLOSE for
any or all of the ports it has open, the ports are closed automatically during
the process termination sequence. If the port is not specified to be a
permanent port by the last process to open the port, it is destroyed when the
last opener closes the port. If the port is a permanent port, it remains
after the last process closes it.
Asynchronous ports are always temporary and have only a single receiver (the
creator); therefore, when the creating process terminates or calls
AIFPORTCLOSE with receive access, subsequent sends to the port return
an error since the receiver no longer exists. See "Operation Notes" on
AIFPORTOPEN for more details on asynchronous ports.
|