snarkOS
snarkOS copied to clipboard
TCP review - adds comments, tests, and reorganizes some methods
Motivation
This PR adds and updates comments and traces in the Tcp stack, and reorganizes methods for easier readability.
The following are the only logic changes to the Tcp stack.
- Abstracts the listening task logic into 2 new methods:
enable_listenerandhandle_connection - Adds
Tcp::connecting_addrsto retrieve the pending IP addresses - (https://github.com/AleoHQ/snarkOS/pull/2143/commits/316c75654a2753857aeb747bb065ad150c497d46) Switches
!can_add_connectionerror fromPermissionDeniedtoConnectionRefused
Test Plan
This PR adds tests on the following Tcp methods:
newconnectdisconnectcan_add_connectionhandle_connectionadapt_stream
Related PRs
None
@ljedrz I was careful to ensure no logic changes took place besides the 3 bullet points enumerated in this PR description.