CORBA 2.3.3 Programmer's Guide for C++

The semantics of the NonStop CORBA event handlers lend themselves readily to TCP/IP, which is a streaming protocol.
However, more specific protocols were developed to provide the correct semantics for GIOP over the Guardian file
system and GIOP over TS/MP. Therefore the socket event handlers defined in the event framework are likely to fit the
needs of a legacy wrapper, but the file-system and TS/MP event handlers in the event framework often will not do so.
This means that to provide a legacy file-system or TS/MP application with the semantics it expects, you may need to
implement your own server or client event handlerthat is, have your legacy wrapper act as an event handler. However, in
such cases it still may be possible for the listener portion of a client wrapper to use the listener event handler provided by
NonStop CORBA, acting as a listener event-handler user.
The handle_event Method
A program acting as an event handler must implement a method called handle_event(). This method is invoked by
a callback from the NonStop CORBA event framework when the event framework receives an I/O event of a type
registered by the event handler. The callback includes an event object containing all information necessary to identify the
event.
The method implementation should do whatever is appropriate with all relevant I/O events.
Listener Event Handler and Event-Handler User
The basic functions of a listener event-handler user and a listener event handler are shown in Figure 123 .
Figure 11.3. Listener Event Handler and Event-Handler User
Transfer Event Handler and Event-Handler User
The transfer event handler and event-handler user is a layer of abstraction added so that the GIOP components don't need
to know whether they are playing the client or the server role. A transfer event handler provides a continuous
receive/send-on-demand service. Messages are usually sent as one large entity (called a Message) but received in
fragments (called message descriptors, or MDs). Messages, implemented as a list of MDs, are passed to the handler.
Received data is passed to the user in the form of MDs.
The basic functions of a transfer event-handler user and a transfer event handler are shown in Figure 124 .
Figure 11.4. Transfer Event Handler and Event-Handler User