Posts Tagged ‘URL’

Stuck in SYN-SENT

Thursday, November 13th, 2008

Recently, in an Adobe Flex project running on Windows OS, I was noticing a huge delay when tearing down the process.  The process used URLMonitor to access a service and, if the service was unreachable or if a timer went off, it just exited.

By the way, URLMonitor just sends out an HTTP request.   In our application if the timer went off URLMonitor.stop() was called and the application exited.

Upon exit(), the application would disappear from Windows Task Manager, but the process would still be in the task list.   By running a netstat, we saw that the process still held a socket in the SYN_SENT state.  (For a pretty good diagram of TCP socket state machine, see wikipedia.)

In Windows, the process wouldn’t return to the OS or .bat file, until this socket state was cleared up.