This section describes what needs to be configured before your application program can use the user-defined communications APIs. You can either use the system-supplied menus or the Control Language (CL) commands to do this configuration. For more information about using queue APIs, see Object APIs.
Links allow your application program to use a token-ring, Ethernet, FDDI, wireless, or X.25 communications line. A link is made up of the following communications objects:
You need to configure the line description; user-defined communications support automatically configures a network controller and a network device description of type *USRDFN when the link is enabled. If you are using X.25 over ISDN, the network interface description must also be configured. The network interface, line, controller, and device descriptions are automatically varied on, if necessary.
Use the following commands to create or change line descriptions:
Use the following commands to create or change controller descriptions:
Use the following commands to create or change device descriptions:
Use the following commands to create or change network interface descriptions:
See the Communications Configuration manual, SC41-5401, for more information about configuring communications. This manual is not included in this release of the IBM® i Information Center; however, it is available from the IBM Publications Center as a printed hardcopy that you can order or in an online format that you can download at no charge.
User-defined communications support uses a queue to inform your application program of some action to take or of an activity that is complete. You must create the queue before the link is enabled.
The size of each queue entry must be large enough to accommodate the user-defined communications support entries. See the following Queue Entries for more information about the entries that user-defined communications support can send to the queue.
Use the Create Data Queue (CRTDTAQ) command to create your data queues. Use the QUSCRTUQ and QUSDLTUQ APIs to create and delete your user queues.
This section describes the entries user-defined communications support can send to the queue.
The length of each entry is always at least 80 bytes. When using a keyed queue, however, each entry can be as large as 336 bytes, depending on the size of the key value supplied to the user-defined communications support.
Table 1 shows the general format of each user-defined communications support entry.
Table 1. Queue Entry General Format
Entry type Char(10) | Entry ID Char(2) | Entry data Char(68) | Key CHAR(256) |
---|---|---|---|
Bytes 1-10 | 11-12 | 13-80 | 81-336 |
Note: The entry type of *USRDFN and all associated entry IDs, either defined or undefined, are reserved for user-defined communications support. Therefore, your application program should not define entries using this entry type.
The enable-complete entry is sent to the queue when the enable link operation is complete. This entry is only sent after the Enable Link (QOLELINK) API returns to your application program with a successful return and reason code.
Note: The QOLELINK API only initiates the enabling of the link. Your application program must wait for the enable-complete entry before attempting to perform input or output on the link.
Table 2 shows the format of the enable-complete entry.
Table 2. Enable-Complete Entry
*USRDFN | '00' | Communications handle | Status | Reserved | Key |
---|---|---|---|---|---|
Bytes 1-10 | 11-12 | 13-22 | 23 | 24-80 | 81-336 |
The disable-complete entry is sent to the queue when a link is successfully disabled. This entry is always the last entry sent by the user-defined communications support on this link and, therefore, provides a way for your application program to remove any enable-complete, incoming-data, or permanent-link-failure entries previously sent to the queue.
Note: User-defined communications support does not associate timers with links. Therefore, it is possible for a timer-expired entry to be sent to the queue after the link is disabled. Your user-defined communications application program is responsible for handling this.
Table 3 shows the format of the disable-complete entry.
Table 3. Disable-Complete Entry
*USRDFN | '01' | Communications handle | Reserved | Key |
---|---|---|---|---|
Bytes 1-10 | 11-12 | 13-22 | 23-80 | 81-336 |
The permanent-link-failure entry is sent to the queue when error recovery is canceled on a link. You must disable and then enable the link to recover.
Table 4 shows the format of the permanent-link-failure entry.
Table 4. Permanent-Link-Failure Entry
*USRDFN | '02' | Communications handle | Reserved | Key |
---|---|---|---|---|
Bytes 1-10 | 11-12 | 13-22 | 23-80 | 81-336 |
The incoming-data entry is sent to the queue when the user-defined communications support has data for your application program to receive. Your application program should call the Receive Data (QOLRECV) API to pick up the data when this entry is received.
Note: Another incoming-data entry is not sent to the queue until your application program picks up all the data from the user-defined communications support. The data available parameter on the call to the QOLRECV API indicates that the receipt of data is not complete.
Table 5 shows the format of the incoming-data entry.
*USRDFN | '03' | Communications handle | Reserved | Key |
---|---|---|---|---|
Bytes 1-10 | 11-12 | 13-22 | 23-80 | 81-336 |
The timer-expired entry is sent to the queue when a timer, previously set by your application program, ends.
Table 6 shows the format of the timer-expired entry.
*USRDFN | '04' | Timer handle | User data | Key |
---|---|---|---|---|
Bytes 1-10 | 11-12 | 13-20 | 21-80 | 81-336 |