You will only access an IB proc when a message is received unless you put it all in start mode. Or, as an alternative in the top of a namespace. The namespace is run as soon as proc is loaded.
Also consider a Protocol Startup proc. Remember the magic command, engStartupSwitchThrow 😀
You do not understand. The command engStartupSwitchThrow is used *ONLY* in a Protocol Startup proc. Until it is issued the thread cannot process messages. That is probably where I would put the shutdown if I wanted to make sure I did not have to wait on a message or have a message partially processed. Even if issued in startup mode of an IB proc there is the possibilty of messages before the shutdown.
I am shooting in the dark here as I have no idea what you are really trying to do.
However, if you want to stop the process, regardless of where you do it you should set up a shell script. or .bat file if on Windows. In that script run the command “hcienginestop -p ” in the background.
If done within the proc itself you are telling the proc to commit suicide – never a good thing.
If you do this in a message processing mode you should also return the empty sting (“”) so any messages remain in the recovery database since the shutdown is not instantaneous.
As stated above, a bit more insight into what you are really trying to do would be helpful.
engStartupSwitchThrow is *NOT* used to stop a process!. It release the message flow through the thread once your processing has finished in the Protocol Startup proc.
Did you not see my recommendation to exec a script?
I can offer no more unless I know what you are trying to do. Stop the process based on what?