[zeromq-dev] Improvement(?) for binding and connecting sockets using single method

Panu Wetterstrand panu.wetterstrand at iki.fi
Wed May 14 11:37:38 CEST 2014


Yes, but that is not such big problem if all options are set up before any
connection/bind. In this case one could "associate" socket after all
settings are done. However if one has to do some changes between operations
like this:

     connect socket to X
     made some changes to settings
     bind socket to Y

In this case one step connect/bind method is not very helpful.




2014-05-14 12:10 GMT+03:00 Pieter Hintjens <ph at imatix.com>:

> Almost all socket options (see
> http://api.zeromq.org/4-0:zmq-setsockopt) have to be set before
> bind/connect. Security is part of that.
>
> On Wed, May 14, 2014 at 10:35 AM, Panu Wetterstrand
> <panu.wetterstrand at iki.fi> wrote:
> > I was aware that could be a problem...
> >
> > Are there many parameters that have to be set (or changed) between
> multiple
> > connect or bind operations.
> > If I remember correctly there are some curve related operations, but not
> > many others?
> >
> >
> >
> >
> > 2014-05-14 11:08 GMT+03:00 Pieter Hintjens <ph at imatix.com>:
> >
> >> Hi Panu,
> >>
> >> I've played with something similar for CZMQ, where I wanted a simple
> >> socket constructor that would bind and/or connect a new socket
> >> immediately.
> >>
> >> My idea was to prefix the endpoint with '@' ("at") to mean bind, and
> >> otherwise treat it as connect.
> >>
> >> I didn't implement it because in many cases you must specify
> >> additional socket options before binding or connecting.
> >>
> >> One idea I had was to define socket "models" so you could configure a
> >> model with all the necessary options, then use it at construction
> >> time.
> >>
> >> -Pieter
> >>
> >>
> >>
> >>
> >>
> >> On Wed, May 14, 2014 at 9:32 AM, Panu Wetterstrand
> >> <panu.wetterstrand at iki.fi> wrote:
> >> > Hello,
> >> >
> >> > we have lots of small ZeroMQ devices written in Java. Mostly we need
> to
> >> > specify how socket connect to others as command line parameter.
> Because
> >> > there is two different methods connect and bind this is not straight
> >> > forward. First we have to parse if we should bind or connect and then
> >> > call
> >> > the correct method.
> >> >
> >> > To ease this we have written parser that accepts urls like this:
> >> >
> >> >     connect:tcp://localhost:1234
> >> >     bind:tcp://*:5555:123;connect:ipc:/tmp/blaah
> >> >
> >> > Thus the idea is that one can spesify connection or bind before the
> >> > actual
> >> > zeromq url. Also multiple urls can be definer by separating them using
> >> > ;-character.
> >> >
> >> > (Java library can be found here
> >> > https://bitbucket.org/jyukopla/java-zmq-utils)
> >> >
> >> > My question is:
> >> > Would it make any sense implement method to ZeroMQ library that would
> do
> >> > the
> >> > same thing? Signature would be something like this:
> >> >
> >> >     int zmq_associate (void *socket, const char *urlstring);
> >> >
> >> >
> >> > --
> >> > Panu
> >> >
> >> > _______________________________________________
> >> > zeromq-dev mailing list
> >> > zeromq-dev at lists.zeromq.org
> >> > http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> >> >
> >> _______________________________________________
> >> zeromq-dev mailing list
> >> zeromq-dev at lists.zeromq.org
> >> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> >
> >
> >
> > _______________________________________________
> > zeromq-dev mailing list
> > zeromq-dev at lists.zeromq.org
> > http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> >
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140514/7589fdc9/attachment.htm>


More information about the zeromq-dev mailing list