[zeromq-dev] Access to underlying Linux socket?

Pieter Hintjens ph at imatix.com
Wed Feb 10 23:06:49 CET 2016


There is a test case (and a man page) on libzmq/master, search for
ZMQ_USE_FD in zmq_setsockopt.

On Wed, Feb 10, 2016 at 9:38 PM, Mark Gillott <mgillott at brocade.com> wrote:
> On Wed, 2016-02-10 at 20:45 +0100, Pieter Hintjens wrote:
>> You can't do this really, since one ZeroMQ socket can map to 0..n
>> system sockets.
>>
>
> Had a feeling that was going to be the case.
>
>> There is a new option on libzmq master that lets you pre-configure a
>> FD and give it to ZeroMQ to use for its first pipe. (ZMQ_USE_FD).
>>
>
> Care to expand a bit more? Is there something (test code? source module)
> you can point me at?
>
>> A custom hook to configure new sockets is a nice idea.
>>
>
> So you register a hook with a newly created socket and you would get a
> callback just prior to any bind/connect. Is that the idea? In czmq
> terms, something like:
>
> s = zsock_new(ZMQ_REP)
> zsock_configure(s, myfunc, myarg)
> zsock_bind(s)
>
> The callback would be provided with the base socket?
>
> Thanks,
>
> Mark
>
>> -Pieter
>>
>> On Wed, Feb 10, 2016 at 6:29 PM, Jerry Scharf
>> <scharf at lagunawayconsulting.com> wrote:
>> > Mark,
>> >
>> > As a comment from the peanut gallery, it is generally a bad thing to
>> > leak that information up the protocol stack. Rather than getting that
>> > information back, it might be better to be able to attach user callout
>> > hooks at the places where you would want to make changes. That way there
>> > is still a unified code base and you can write and install your hook
>> > code to do your special work. It also allows people to do other things
>> > without needing to invent another mechanism.
>> >
>> > That's the way I have liked it the best when these things came up with
>> > other systems.
>> >
>> > jerry
>> >
>> > On 02/10/2016 07:50 AM, Mark Gillott wrote:
>> >> [I'm sure this must have been asked before, but can't find anything]
>> >>
>> >> Is there a facility or method to "map" a 0MQ socket to its supporting
>> >> Linux socket?
>> >>
>> >> Working with a Linux kernel that has some new networking facility
>> >> together with socket extensions to control the facility. With vanilla
>> >> sockets this results in calls to setsockopt(sockfd, SOL_SOCKET, ...).
>> >>
>> >> But how do I manage 0MQ sockets wanting to enable/control this facility?
>> >> Can I obtain the Linux socket and thus use native setsockopt() calls? Or
>> >> is the only option to generate (& maintain) zmq_set_xyz() & zmq_xyz()
>> >> patches for the base ZMQ library (together with the various language
>> >> binding - C, Python, Perl, etc)?
>> >>
>> >> Cheers,
>> >>
>> >> Mark
>> >>
>> >> _______________________________________________
>> >> zeromq-dev mailing list
>> >> zeromq-dev at lists.zeromq.org
>> >> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.zeromq.org_mailman_listinfo_zeromq-2Ddev&d=CwICAg&c=IL_XqQWOjubgfqINi2jTzg&r=jvQi-CKjLvh8eMz9WSgpXPemqlgP9vG7H0zwS3acfHk&m=0hDDdkf0P3ySnqh5QzyjSsxZ80Vc3GGXl0hFFQsq1SU&s=2Xu9Jr_yHb-drSVHhsw4TPO6LNFJdyYqqH6EkCnsNHo&e=
>> >
>> > _______________________________________________
>> > zeromq-dev mailing list
>> > zeromq-dev at lists.zeromq.org
>> > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.zeromq.org_mailman_listinfo_zeromq-2Ddev&d=CwICAg&c=IL_XqQWOjubgfqINi2jTzg&r=jvQi-CKjLvh8eMz9WSgpXPemqlgP9vG7H0zwS3acfHk&m=0hDDdkf0P3ySnqh5QzyjSsxZ80Vc3GGXl0hFFQsq1SU&s=2Xu9Jr_yHb-drSVHhsw4TPO6LNFJdyYqqH6EkCnsNHo&e=
>> _______________________________________________
>> zeromq-dev mailing list
>> zeromq-dev at lists.zeromq.org
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.zeromq.org_mailman_listinfo_zeromq-2Ddev&d=CwICAg&c=IL_XqQWOjubgfqINi2jTzg&r=jvQi-CKjLvh8eMz9WSgpXPemqlgP9vG7H0zwS3acfHk&m=0hDDdkf0P3ySnqh5QzyjSsxZ80Vc3GGXl0hFFQsq1SU&s=2Xu9Jr_yHb-drSVHhsw4TPO6LNFJdyYqqH6EkCnsNHo&e=
>
> _______________________________________________
> 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