-
-
Notifications
You must be signed in to change notification settings - Fork 2k
LibCore: Implement TCPServer+UDPServer+LocalServer on Windows #5435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
LibCore: Implement TCPServer+UDPServer+LocalServer on Windows #5435
Conversation
f26271e
to
57cc947
Compare
57cc947
to
686de21
Compare
3426f22
to
3827648
Compare
These are the set of tests that were already building and passing with little to no modifications required.
Winsock2 doesn't seem to support blocking sockets, or at least not in the naiive way.
c7f1cee
to
b01f7ca
Compare
b01f7ca
to
5f0d986
Compare
@@ -109,10 +110,15 @@ ErrorOr<struct stat> fstat(int handle) | |||
return st; | |||
} | |||
|
|||
ErrorOr<void> ioctl(int, unsigned, ...) | |||
ErrorOr<void> ioctl(int fd, unsigned request, ...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we somehow make sure we are trying this on a socket fd? If someone didn't read the implementation of this they might think we have somehow gotten an ioctl equivalent which is not the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe not call this ioctl at all and just wrap ioctlsocket in a LibCore api.
Demo
To test my impls I made simple Marco-Polo servers where a Python or C++ client connects and starts a 5 entry long chain of "macro!" (Client) and "polo!" (Server) back and forth messages. After the 5th "polo!" is sent, the Server shuts down.
TCPServer
TCPServerWindows_Demo.mp4
Here is the code for both the Macro-Polo server and the python Client.
TestTCPServer.cpp
TestTCPServer.py
UDPServer
UDPServerWindows_Demo.mp4
Here is the code for both the Macro-Polo server and the python Client.
TestUDPServer.cpp
TestUDPServer.py
LocalServer
LocalServerWindows_Demo.mp4
Here is the code for both the Macro-Polo server and the C++ Client (Python doesn't seem to support connecting for Winsock2-based local sockets).
TestLocalServer.cpp
TestLocalSocket.cpp.