funker
funker copied to clipboard
About "Once it has been called, the function refuses any other connections"
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
Opened PR for funker-go https://github.com/bfirsh/funker-go/pull/2
Thanks! Node and Python should behave like this, I just couldn't figure it out for Go.
I haven't tested Node yet, but Python seems not working as expected. I'll look into that later.
Thanks. Will re-open while we investigate.
Also worth noting that this may be redundant, depending on what we do here: https://github.com/bfirsh/funker/issues/6