mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-06 01:26:22 +00:00
LibCore: Implement LocalSocket on Windows
Windows flavor of non-blocking IO, overlapped IO, differs from that on Linux. On Windows, the OS handles writing to overlapped buffer, while on Linux user must do it manually. Additionally, we can only have overlapped sockets because it is the requirement to be able to wait on them - WSAEventSelect automatically sets socket to nonblocking mode. So we end up emulating Linux-nonblocking sockets with Windows-nonblocking sockets. Pending IO state (ERROR_IO_PENDING) must not escape read/write functions. If that happens, all synchronization like WSAPoll and WaitForMultipleObjects stops working (WaitForMultipleObjects stops working because with overlapped IO you are supposed to wait on an event in OVERLAPPED structure, while we are waiting on WSA Event, see EventLoopImplementationWindows.cpp).
This commit is contained in:
parent
8088ab5306
commit
e1f70d532c
Notes:
github-actions[bot]
2025-02-10 19:47:27 +00:00
Author: https://github.com/stasoid
Commit: e1f70d532c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3493
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/R-Goc
Reviewed-by: https://github.com/konradekk
Reviewed-by: https://github.com/trflynn89
2 changed files with 165 additions and 1 deletions
|
@ -43,7 +43,6 @@ set(SOURCES
|
|||
Resource.cpp
|
||||
ResourceImplementation.cpp
|
||||
ResourceImplementationFile.cpp
|
||||
Socket.cpp
|
||||
SystemServerTakeover.cpp
|
||||
TCPServer.cpp
|
||||
ThreadEventQueue.cpp
|
||||
|
@ -54,11 +53,13 @@ set(SOURCES
|
|||
if (WIN32)
|
||||
list(APPEND SOURCES
|
||||
ProcessWindows.cpp
|
||||
SocketWindows.cpp
|
||||
AnonymousBufferWindows.cpp
|
||||
EventLoopImplementationWindows.cpp)
|
||||
else()
|
||||
list(APPEND SOURCES
|
||||
Process.cpp
|
||||
Socket.cpp
|
||||
AnonymousBuffer.cpp
|
||||
EventLoopImplementationUnix.cpp)
|
||||
endif()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue