Hmm, one option is to charge a good money for processing such heavy queries. So even if some queries are lost (and left unpaid), you still have a good cash anyway ;)
P.S. I don't know sockets/networking deep enough to answer how it should be done, but yes it sounds like there should be such kind of event in case when client dropped.