[zeromq-dev] Twisted integration, part 2: review

Laurens Van Houtven lvh at laurensvh.be
Fri Jun 4 23:47:50 CEST 2010


On Fri, Jun 4, 2010 at 11:06 PM, Martin Sustrik <sustrik at 250bpm.com> wrote:
>
>
> Laurens,
>
> I fully understand the "if it runs on top of TCP it's a TCP app"
> approach. However, it should be pointed out that 0MQ works on top of
> TCP, UNIX domain pipes, PGM reliable multicast, UDP (in form of
> encapsulated PGM) and even inter-thread communication mechanism. This
> makes it somehow more than a "TCP app".

This is a great point that I completely forgot about. Thanks!

> On a different topic: I don't know whether twisted supports raw IP
> sockets. If it does there's a similar problem there -- TCP is just an
> app on top of IP, so why then support both?

AFAIK it does, but nobody uses it because everyone's pretty much happy
with the things it does support. It exists (twisted.pair) but it's one
of those dusty corners that haven't been touched in a long time, so if
you start using it you should be prepared to knock out some cobwebs :)

> I think POSIX got it right by using same API (Bekreley sockets) to access
> different layers in the networking stack. Thus, you can use IP via POSIX
> sockets as well as TCP. Hell, you can even send Etrhernet frames. The
> fact that TCP is layered on top of IP and IP i layered on top of
> Ethernet is not a problem. In the same way 0MQ can be (hypothetically)
> accessed via Berkeley sockets. The fact that it's layered on top of TCP
> doesn't matter.
>
> Doesn't twisted subscribe to this "access any layer via single
> interface" approach?

Not usually, but it can, see above. Normally it uses SOCK_STREAM and SOCK_DGRAM.

> Yet once more on a different topic: I still think creating a wrapper
> library on top of 0MQ that would expose 0MQ via POSIX socket API would
> solve lot of problems (including the twisted case) -- simply because 0MQ
> sockets would become standard file descriptors, there would be no need
> for 0MQ-specific zmq_poll, standard poll/select could be used instead
> etc.
>
> Am I still the only one who thinks this idea makes sense?

It makes sense to be, but I don't know anything about ZeroMQ.

> Martin
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>

Thanks,
Laurens



More information about the zeromq-dev mailing list