mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-28 05:07:35 +00:00
LibCore: Make TCPServer::set_blocking() unsupported on Windows
Winsock2 doesn't seem to support blocking sockets, or at least not in the naiive way.
This commit is contained in:
parent
d236e1a509
commit
79594279da
Notes:
github-actions[bot]
2025-08-07 02:26:05 +00:00
Author: https://github.com/ayeteadoe
Commit: 79594279da
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5435
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/R-Goc
1 changed files with 5 additions and 2 deletions
|
@ -68,9 +68,12 @@ ErrorOr<void> TCPServer::listen(IPv4Address const& address, u16 port, AllowAddre
|
|||
return {};
|
||||
}
|
||||
|
||||
ErrorOr<void> TCPServer::set_blocking(bool blocking)
|
||||
ErrorOr<void> TCPServer::set_blocking(bool const blocking)
|
||||
{
|
||||
TRY(Core::System::ioctl(m_fd, FIONBIO, blocking ? 0 : 1));
|
||||
// NOTE: Blocking does not seem to be supported. Error code returned is WSAEINVAL
|
||||
if (!blocking)
|
||||
return Error::from_string_literal("Core::TCPServer: WinSock2 does not support blocking");
|
||||
TRY(Core::System::ioctl(m_fd, FIONBIO, 1));
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue