It would be really convenient to subclass a dlib::connection with for example a virtual void on_close().
This would be called at the time the connection is being dropped.
Why is this convenient for me?
I am creating an 'always-on' connection. And I need to see if the connection is active or not. Ofcourse I can check the output from read/write, but it would be nice if I just got called in those instances the connection dropped so I can do some other actions.
At the moment I just check if read/write == SHUTDOWN, and then call on_close(), but it would be nice to have it called automagically ;)