Skip to content
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

Wait until server is closed before invoking callback #149

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Pwndrian
Copy link

@Pwndrian Pwndrian commented Jul 18, 2023

With the current implementation, there is a chance that a user binds a socket on a port (that was reported as being available) although the server (created to check whether that port is available) is not fully closed yet. This causes the binding to fail, because the port is still in use.

In this PR, we change the implementation such that the the callback passed to the testPort is invoked when the server is fully closed. Thanks to @sla89 for the idea!

Unfortunately, we didn't manage to write a unit tests that reliably verifies the correct behavior. I'm open for ideas ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant