Is it possible to pass in an existing socket for Twisted to listen on?

268 Views Asked by At

I'm building some Twisted/Klein services for some command-line tools I am writing and I would like to use systemd's socket units. To do that, I would need to accept the socket via a file descriptor when the application starts and pass that socket to Twisted so that it can listen on that socket. Is this possible?

1

There are 1 best solutions below

2
On

Yes, this is definitely possible. In fact, an entire chapter within the Twisted documentation is dedicated to systemd; you should read it.