Conversation
|
I was not able to get the |
|
@deadprogram looks like net.Listener is not working correctly. If I tap in directly to lneto's StackGo it works. Will use that instead |
|
Alright, not entirely happy with net.Listener failure, but that's something out of the scope of this PR |
|
Also we'd need to merge soypat/lneto#173 before merging this. If it works for you too throw in a good word for the PR so we can upgrade the httphi API! |
|
|
||
| func Listen(link *netlink.Esplink, port string) (net.Listener, error) { | ||
| // Listen by asking the lneto stack for a socket directly instead of going | ||
| // through stdlib net.Listen and the netdev file descriptor layer due to a bug. |
There was a problem hiding this comment.
It's as if Listen never opened the port in the stack so when a TCP packet arrives at port 80 (the one it supposedly opened and did not return an error) the stack sends an RST back, which is what it should do when no socket is registered on that port.
ComparisonBefore~10kB of allocations every time "On" button clicked in webserver example. After~12B of allocations every time "On" button clicked in webserver example |
So I saw an opportunity to ditch net/http entirely (Except client case) which seems like a huge win especially when the resulting HTTP handling reads better in most cases (except form parsing, though more explicit on what is happening). Check it out!
I do keep net dependency for net.Listener though- it is a very nice abstraction.