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

Inetd activation #18

Closed
stephane-martin opened this issue Nov 21, 2018 · 4 comments
Closed

Inetd activation #18

stephane-martin opened this issue Nov 21, 2018 · 4 comments

Comments

@stephane-martin
Copy link

Hello,

In classical inetd activation, inetd already "Accept"s the incoming connection from client, and then passes the accepted connection to the daemon.

In that case I need to bypass the Accept() call that happens in the Serve() method (server.go line 83).

Unfortunately the handleConn method is private, so I can't call it directly.

Hence my very small feature request: rname handleConn to HandleConn :)

Thanks,
Stephane

@stephane-martin
Copy link
Author

Oh, and newConn too !

@emersion
Copy link
Owner

How is this handled with e.g. net/http?

@stephane-martin
Copy link
Author

That's a very good question indeed.

I don't think that net/http has any special to handle inetd services.

But that pointed me in the right direction: wrap net.Listener and net.Conn to make the Accept() call a no-op.

https://gist.github.com/stephane-martin/57a19466633b7ce712945aaed7a0e751

Please be free to comment/propose something else!

@emersion
Copy link
Owner

Does this work? If so, this seems like a better idea.

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

No branches or pull requests

2 participants