mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 09:34:57 +09:00
LibCore: Allow listening for socket errors and hang-ups
This commit is contained in:
parent
6836091a21
commit
506707cc2b
Notes:
sideshowbarker
2024-07-17 01:27:18 +09:00
Author: https://github.com/DanShaders
Commit: 506707cc2b
Pull-request: https://github.com/SerenityOS/serenity/pull/23046
Reviewed-by: https://github.com/ADKaster
2 changed files with 6 additions and 0 deletions
|
@ -83,6 +83,8 @@ enum class NotificationType {
|
|||
None = 0,
|
||||
Read = 1,
|
||||
Write = 2,
|
||||
HangUp = 4,
|
||||
Error = 8,
|
||||
};
|
||||
|
||||
AK_ENUM_BITWISE_OPERATORS(NotificationType);
|
||||
|
|
|
@ -267,6 +267,10 @@ try_select_again:
|
|||
type |= NotificationType::Read;
|
||||
if (has_flag(revents, POLLOUT))
|
||||
type |= NotificationType::Write;
|
||||
if (has_flag(revents, POLLHUP))
|
||||
type |= NotificationType::HangUp;
|
||||
if (has_flag(revents, POLLERR))
|
||||
type |= NotificationType::Error;
|
||||
type &= notifier.type();
|
||||
if (type != NotificationType::None)
|
||||
ThreadEventQueue::current().post_event(notifier, make<NotifierActivationEvent>(notifier.fd(), type));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue