Opened 2 years ago
Last modified 13 months ago
#18327 closed bug
select() does not report disconnect events — at Version 3
Reported by: | LekKit | Owned by: | axeld |
---|---|---|---|
Priority: | normal | Milestone: | R1/beta5 |
Component: | Network & Internet/TCP | Version: | R1/beta4 |
Keywords: | select, tcp, network | Cc: | |
Blocked By: | Blocking: | ||
Platform: | All |
Description (last modified by )
When another end of the TCP socket is closed, select() should report that in rfds set. It doesn't as of hrev56862, and doesn't wake from blocking either. This prevents any software using select() from tracking disconnect events, and freeing clients appropriately.
Attached a tiny program that reproduces this. On systems susceptible to the bug it'd hang and never exit.
Update: The poll() facility is subject to this bug as well, i.e. listening for POLLIN | POLLERR | POLLHUP never notices a HUP event.
Update (2): Haiku-specific API wait_for_objects() from <OS.h> also hangs.
Change History (5)
by , 2 years ago
Attachment: | haiku_select_repro.c added |
---|
comment:1 by , 2 years ago
Description: | modified (diff) |
---|
comment:3 by , 2 years ago
Description: | modified (diff) |
---|
Reproduces the issue