I have an application that uses HttpListener, I need to know when the client disconnected, right now I have all my code inside a try/catch block which is pretty ugly and not a good practice.

How can I know if a client disconnected?

thanks!

Edit
Report