if there is no data to send, we should unregister WRITE event

This commit is contained in:
s723138643 2017-04-29 10:22:38 +08:00
parent 3b39c99206
commit ed13036588

View File

@ -167,6 +167,8 @@ def loop() -> None:
fileobj = keymap[fd].fileobj
if fileobj.would_send():
selector.modify(fileobj, selectors.EVENT_READ | selectors.EVENT_WRITE)
else:
selector.modify(fileobj, selectors.EVENT_READ)
def parse_cmdline_arguments() -> typing.Optional[argparse.Namespace]: