diff --git a/Libraries/LibCore/EventLoopImplementationWindows.cpp b/Libraries/LibCore/EventLoopImplementationWindows.cpp index b10cb88e39b..0eefd516081 100644 --- a/Libraries/LibCore/EventLoopImplementationWindows.cpp +++ b/Libraries/LibCore/EventLoopImplementationWindows.cpp @@ -150,7 +150,7 @@ static int notifier_type_to_network_event(NotificationType type) { switch (type) { case NotificationType::Read: - return FD_READ; + return FD_READ | FD_CLOSE; case NotificationType::Write: return FD_WRITE; default: diff --git a/Libraries/LibCore/SocketWindows.cpp b/Libraries/LibCore/SocketWindows.cpp index 084a5a549dd..793d65b2612 100644 --- a/Libraries/LibCore/SocketWindows.cpp +++ b/Libraries/LibCore/SocketWindows.cpp @@ -122,6 +122,8 @@ void PosixSocketHelper::close() if (m_notifier) m_notifier->set_enabled(false); + // shutdown is required for another end to receive FD_CLOSE + shutdown(m_fd, SD_BOTH); MUST(System::close(m_fd)); m_fd = -1; }