Do not try to cancel operations on a socket that isn't open yet.

This commit is contained in:
Sergey Popov 2011-07-07 15:10:57 +00:00
parent d171f5cd57
commit d8cd6f18b1

View File

@ -110,7 +110,7 @@ class connection
*/
void run() { io_service_.run(); }
void cancel() { socket_.cancel(); }
void cancel() { if(socket_.is_open()) { socket_.cancel(); } }
/** True if connected and no high-level operation is in progress */
bool done() const { return done_; }