Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To prepare for a more end-to-end testing framework, I forked UnixSocketHandler (USH) to create TcpSocketHandler and PipeSocketHandler that both inherit from USH. To create a unified interface, I created SocketEndpoint, which has either port and/or name set. In the case of PipeSocketHandler, there is no port so it will be -1 (unset). For TcpSocketHandler, we don't have a name when listening on a port on all interfaces, but otherwise both will be set.
RawSocketUtils is now only used when communicating to stdout/stdin or to the terminal pty file descriptor (basically, cases where we only control one endpoint so we have to send raw data without any protocol).
One nice effect of this is that we can swap a TCP connection for an IPC connection whenever we want. This is used in TestBacked where we now use IPC connections instead of TCP. This means we can run thousands of tests in parallel without having to worry about port collisions, which is important for when we want to stress the system.
Also, I made all sockets non-blocking at all times. Currently we still block ourselves in a while loop above many of the calls, but in the future I plan on making the system more asynchronous so we can remove all multi-threaded programming and let the OS handle the concurrency.