DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Developing applications using XTI or TLI

Event management

XTI allows a process to manage multiple transport endpoints in a fully asynchronous manner using an event-driven design. In this kind of design, a process waits for any one of several events to occur. When an event occurs, the process discovers which event it is, then transfers control to the code written to handle that event. This code can be executed by the process that waited for the event, or the process can fork(S) a child process to execute the code. While the child process is executing, the parent process can either wait(S) for the child to complete, or it can proceed to process the next event.

XTI does not define its own portable event management facility. Instead, a process must make use of either the poll(S) or select(S) system calls. The process uses these system calls to list the transport endpoints and the events to be monitored. The process can then simply wait until the transport provider notifies it that an event has occurred on one of those transport endpoints. The process checks to see on which endpoint the event has occurred, and executes the code written to handle that kind of event.

See the CAE Specification: X/Open Transport Interface for a fuller discussion of event management. The CAE Specification also includes two code samples, one using poll and the other using select, to illustrate the use of these two system calls as the heart of an event-driven server.


Next topic: Compiling and linking with XTI
Previous topic: Options management

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003