Debugging and Monitoring Applications > Using onStatus event handlers > Putting onStatus handlers in the right place in a script

 

Putting onStatus handlers in the right place in a script

Because of network and thread timing issues, it is best to place an onStatus handler before a connect method in a script. Otherwise, the connection might complete before the script executes the onStatus handler initialization. Also, all security checks are made within the connect method, and notifications will be lost if the onStatus handler is not yet set up.