Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

tower-abci: add bound tcp server #55

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

SuperFluffy
Copy link
Contributor

This patch adds a Server::bind_tcp method
returning a BoundTcpServer server to query
the local address the server is bound to.

To avoid clashing on occupied ports, blackbox
tests bind to the zero-port (as in 0.0.0.0:0)
and are assigned a random free port by the system.

Because the Server::listen_tcp method binds
and accepts a port in one go, it is currently not
possible to programmatically return the port the
server bound.

With this patch binding a port and accepting
requests is split into a Server::bind_tcp and
BoundTcpServer::accept. Server::listen_tcp is
implemented in terms of these.

This is only implemented for the v0.38 server.
If the direction is acceptable I can extend this
to the other servers.

This patch adds a `Server::bind_tcp` method
returning a `BoundTcpServer` server to query
the local address the server is bound to.

To avoid clashing on occupied ports, blackbox
tests bind to the zero-port (as in `0.0.0.0:0`)
and are assigned a random free port by the system.

Because the `Server::listen_tcp` method binds
and accepts a port in one go, it is currently not
possible to programmatically return the port the
server bound.

With this patch binding a port and accepting
requests is split into a `Server::bind_tcp` and
`BoundTcpServer::accept`. `Server::listen_tcp` is
implemented in terms of these.
@SuperFluffy
Copy link
Contributor Author

It looks like CI failed due to unrelated clippy lints (similar to other open PRs that fail due to clippy).

@erwanor erwanor self-requested a review December 25, 2024 20:12
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant