Boost::asio - how to interrupt a blocked tcp server thread?

后端 未结 5 533
野的像风
野的像风 2020-11-30 04:17

I\'m working on a multithreaded application in which one thread acts as a tcp server which receives commands from a client. The thread uses a Boost socket and acceptor to w

5条回答
  •  忘掉有多难
    2020-11-30 04:41

    Simply call shutdown with native handle and the SHUT_RD option, to cancel the existing receive(accept) operation.

提交回复
热议问题