问题
I am trying to debug a socket connection issue between flash in a web browser and flash in a client type program. The connection is closing properly in the web, so I would like to understand how the web side of things work.
Right now I can load up a remote flash file in a web browser and that triggers a connection ESTABLISHED stat when viewing with netstats -fn. When I close the dialog which runs some javascript to remove the flash from the dom, the connection stats goes to TIME_WAIT.
Does the act of removing the flash from the html DOM sever the flash connection which triggers a TIME_WAIT state? How does that process work?
回答1:
If you're using flash.net.Socket, observe the behavior of calling socket.close() manually. It's up to the Flash runtime (as it's a fully binary plugin separate from the browser) how to close sockets.
The TIME_WAIT state is part of your computer's networking stack. When you actively close a socket, it goes into the TIME_WAIT state.
TIME-WAIT - represents waiting for enough time to pass to be sure the remote TCP received the acknowledgment of its connection termination request.
来源:https://stackoverflow.com/questions/7677680/how-does-flash-and-socket-connections-work-on-the-web