Пример #1
0
    ~asio_connection()
    {
#if !defined(_WIN32_WINNT) || (_WIN32_WINNT >= 0x0600)
        socket_.cancel();
#endif
        //socket_.shutdown(socket_base::shutdown_both);
        socket_.close();
    }
Пример #2
0
 virtual void close() {
   if (!closed) closed = 1;
   
   if (clientSocket->is_open()) {
     clientSocket->cancel();
     clientSocket->close();
   }
   
   if (serverSocket.is_open()) {
     serverSocket.cancel();
     serverSocket.close();
   }
 }