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

About "Once it has been called, the function refuses any other connections" #9

Open
AkihiroSuda opened this issue Dec 8, 2016 · 4 comments

Comments

@AkihiroSuda
Copy link

The README.md in this repo says

Once it has been called, the function refuses any other connections. Once it has responded, the function closes the socket and quits immediately.

The current code tries to implement this behavior by setting "backlog" to 1 in listen(2).

However, it does not work as expected.

Expected behavior

It should "refuse" the second connection (i.e. send TCP RST to the client)

Actual behavior

It just "ignore"s the second connection (i.e. stop responding to TCP SYN from the client)


So I suggest just closing the listener socket rather than setting "backlog" to 1.

Please see also: http://www.perlmonks.org/?node_id=940662

@AkihiroSuda
Copy link
Author

Opened PR for funker-go bfirsh/funker-go#2

@bfirsh
Copy link
Owner

bfirsh commented Dec 8, 2016

Thanks! Node and Python should behave like this, I just couldn't figure it out for Go.

@bfirsh bfirsh closed this as completed Dec 8, 2016
@AkihiroSuda
Copy link
Author

I haven't tested Node yet, but Python seems not working as expected. I'll look into that later.

@bfirsh
Copy link
Owner

bfirsh commented Dec 13, 2016

Thanks. Will re-open while we investigate.

Also worth noting that this may be redundant, depending on what we do here: #6

@bfirsh bfirsh reopened this Dec 13, 2016
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

No branches or pull requests

2 participants