fixed issue #6. Clients now unregister when the socket closes
Merge pull request #8 from aglenn/issue#6

fixed issue #6. Clients now unregister when the socket closes