[zeromq-dev] Idea: Create sockets from existing FD

Brandon Carpenter brandon.carpenter at pnnl.gov
Mon Feb 3 17:49:56 CET 2014


I like the idea and was wondering myself if/how ZeroMQ could be used 
with systemd socket activation.

On 02/01/2014 04:32 AM, Goswin von Brederlow wrote:
> Hi,
>
> I've been thinking of using zmq for a little daemon. But I also want
> to support systemd socket activation. Now those two combined make a
> problem.
>
> ZMQ has no way to create a zmq socket given an existing FD. And socket
> activation opens the sockets outside the programm and passes them in
> when the program is started.
>
> Would it be insane to have e.g.:
>
> void *zmq_socket_from_fd(void *context, int type, int fd, bool bound);
>
> Context and type are clear I hope. The fd would be the the file
> descriptor that is already opened and bound would say wether the
> socket is one that was bind()ed or one that was accept()ed/connect()ed.
>
>
> This feature would also allow 2 additional use cases:
>
> 1) restarting without loosing connections (no messages dropped during
>     restart)
>
> 2) handling stdin / stdout
>     Note: Would that need an additional flag to say wether the
>           socket should allow reads or writes.
>
> MfG
> 	Goswin
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev





More information about the zeromq-dev mailing list