Protocol Start-Up Switch
The protocol start-up switch is used to control how protocol messages received from the protocol driver are routed. At thread start-up, a Tcl procedure (if defined) is given control of message flow. It is called once to allow it to set up its initial state. It is then called each time a new protocol message arrives from the connection. The procedure is given the message and it has the option to do whatever it wants with it.
Each time the procedure is called-including the initial call-the return value from the procedure is a list of binary object handles wrapped inside two keyed lists. The first list indicates binary objects that should be written to the connection. The second list indicates binary objects that should be moved to the inbound pre-SMS queue. The reason for the second list is to give the Tcl procedure the opportunity to “pass along” protocol messages that it receives that are uninteresting to it.
While the procedure is running, it has access to the inbound pre-SMS stack. It may remove messages from the queue using Tcl built-in functions. This functionality is provided so it may remove messages that have not yet entered inbound SMS processing.
Once the procedure is done controlling the start-up flow, it toggles the protocol switch from within Tcl. Once the procedure returns arter it has thrown the switch, the procedure will not be called again until the thread is restarted.
Note: The protocol start-up switch is thrown using the engine-only Tcl command engpswthrow. This is required for normal processing. Otherwise, the thread stays in Startup mode.