On Mon, Dec 30, 2013 at 7:59 AM, Tony Seo <tonys...@gmail.com> wrote:
> That situation continued whether "Accept= true" or not in service unit.

The reason I encouraged you to learn more about socket programming is
because this Accept= option isn't some sort of optimization or nuanced
thing you just try either way until you get it working. What layer
handles accept() for connection-oriented protocols (systemd versus a
daemon) is a fundamental aspect of socket programming. If you don't
understand what Accept=true and Accept=false are supposed to do and
just go about trying both, you still have more learning to do.

Specifically, Accept=true means systemd handles the accept() calls and
spawns an instance of the service for each connection. The socket
passed into the service is one corresponding to a single client's
connection. It is therefore appropriate to simply read from and write
to fd=3. Trying to accept() from fd=3 will probably block forever if
it works at all.

Accept=false (the default) means systemd merely handles the listener
socket. The service must make its own accept() calls to get sockets
corresponding to individual client connections. The service should not
directly read from and write from fd=3; it should do that with the
socket instantiated by accept().
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to