# How can I detect that the Flash Player is exiting?

**URL:** https://forum.kirupa.com/t/how-can-i-detect-that-the-flash-player-is-exiting/300804
**Category:** flash
**Created:** [November 28, 2009, 2:21am UTC](https://forum.kirupa.com/t/how-can-i-detect-that-the-flash-player-is-exiting/300804 "2009-11-28T02:21:47Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![DBA](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@DBA](https://forum.kirupa.com/u/DBA)
#### Post date: [November 28, 2009, 2:21am UTC](https://forum.kirupa.com/t/how-can-i-detect-that-the-flash-player-is-exiting/300804/1 "2009-11-28T02:21:47Z")

</div>

I have written a basic chat client that talks to an XML Socket server. When it starts it connects to the socket and works fine. However, when I close the Flash Player it is still occupying a connection to the server.

I am trying to determine how I can trap the close of the Flash Player and programmatically close the connection to the server before the program exits.

Thanks in advance.
