Python SocketServer

后端 未结 2 2081
情书的邮戳
情书的邮戳 2021-01-05 15:56

How can I call shutdown() in a SocketServer after receiving a certain message \"exit\"? As I know, the call to serve_forever() will bl

2条回答
  •  天涯浪人
    2021-01-05 16:27

    No the serve_forever is checking a flag on a regular basis (by default 0.5 sec). Calling shutdown will raise this flag and cause the serve_forever to end.

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题