One solution might be to have a "heartbeat" script -- every 30 seconds or so the host executes a script that updates a field called "last_heartbeat" in the table. This last_heartbeat field is just a timestamp that denotes when the host was last heard from.
Now, every time a client requests a list of hosts, you'd first delete any hosts who you haven't heard from in more than 30 seconds.
This way if a host closes the window, their entry in the table will only last for 30 seconds before becoming obsolete. Of course, there is a discrepancy when a client tries to connect to a disconnected host that hasn't been heard from for LESS than 30 seconds, in which case they will connect to a host that doesn't exist. To remedy this you could reduce the "heartbeat interval" to something like 10 seconds, but this requires more bandwidth on your part.
It's not exactly elegant, but it could be a nice Plan Z.
http://www.youtube.com/watch?v=JyM8EeJizc0 By inarma and tie372 Topdown Online Class-based Shooter
groupGore is a multiplayer shooter with 5 classes: Brute, Laser McGee, Assassin, Druid, and Sniper. Each one has a unique set of weapons and abilities to cater to whatever your playstyle may be. There are currently 3 game modes and 4 maps.
Controls: WASD - Move LMB - Shoot RMB - Use skill # Keys / Mouse Wheel - Select weapon or skill Enter - Chat If you need help learning a class, hover over the ability icons in-game.