Using Flex 4.5 and AIR 2.7. It seem to be buggy for 2 situations,
I declare a timer for the socket private var socketTimer:Timer = new Timer(500,1); Code 1: This code took a few seconds before executing NativeProcess public function onTimerComplete(event:TimerEvent):void { socketMonitor = new SocketMonitor('127.0.0.1',8090); socketMonitor.addEventListener(StatusEvent.STATUS, socketStatusChange); socketMonitor.start(); } private function socketStatusChange(e:StatusEvent):void { if(socketMonitor.available==false && xSo_start==false) { xSo_start=true; xSoDump(); //Execute NativeProcess EXE } } Code 2 (Optimize): This code will execute NativeProcess immediately but after a few mins, NativeProcess will hang by itself without any error: public function onTimerComplete(event:TimerEvent):void { socketMonitor = new SocketMonitor('127.0.0.1',8090); socketMonitor.addEventListener(StatusEvent.STATUS, socketStatusChange); socketMonitor.start(); xSoDump(); } private function socketStatusChange(e:StatusEvent):void { } Code 3 (Optimize): This solve the hanging issue when I place xSoDump on the 2nd line. public function onTimerComplete(event:TimerEvent):void { xSoDump(); socketMonitor = new SocketMonitor('127.0.0.1',8090); socketMonitor.addEventListener(StatusEvent.STATUS, socketStatusChange); socketMonitor.start(); } private function socketStatusChange(e:StatusEvent):void { } SoDump will execute a nativeprocess (Sodump.exe) which will setup a server connection of 127.0.0.1:8090. So the server will interactive with XMLSocket. Is SocketMonitor have any connection with XMLSocket? In certain situation, NativeProcess will hang itself too, this lead me to wonder if anyone encounter the same issue? In code 2, I'm sure SocketMonitor has time out and close the XMLSocket connection after it fail on the first try?