mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01: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
|
|
@ -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…
Reference in New Issue
Block a user