Re: [zeromq-dev] Streamer Operation

2010-12-20 Thread Martin Sustrik
Hi Jeff,

> 1) Can it have multiple outputs like shown below?

Yes.

> 2) If this is allowed, will the streamer send a duplicate to each bound
> output?

Streamer uses load-balancing (it's intended for PUSH/PULL sockets).

If you want the device to send duplicates, use forwarder device and 
PUB/SUB sockets.

Martin
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] I've written a completely new C# API for ZeroMQ

2010-12-20 Thread Alex Forster
I have quite a few gripes with clrzmq and clrzmq2, and NZMQ is incomplete in 
several areas, so over a few weekends this past month I've written a new C# API 
for ZeroMQ based on the 2.0.10 release of zmq.h.

ZeroMQ Interop v0.8.190.10354 (beta)
http://zeromq.codeplex.com

* Feature-complete
* MIT licensed
* Targeted at both Microsoft and Mono .NET 2.0 CLRs (though it does require a 
3.5 compatible compiler, basically for lambda syntax)
* Includes binaries for both 32 and 64bit platforms (without any #ifdefs)

Here's an example using Pub/Sub sockets-

> // Set up a publisher.
> 
> var publisher = new ZmqPublishSocket {
>   Identity = Guid.NewGuid().ToByteArray(),
>   RecoverySeconds = 10
> };
> 
> publisher.Bind( address: "tcp://127.0.0.1:9292" );
> 
> // Set up a subscriber.
> 
> var subscriber = new ZmqSubscribeSocket();
> 
> subscriber.Connect( address: "tcp://127.0.0.1:9292" );
> 
> subscriber.Subscribe( prefix: "" ); // subscribe to all messages
> 
> // Add a handler to the subscriber's OnReceive event
> 
> subscriber.OnReceive += () => {
> 
>   String message;
>   subscriber.Receive( out message, nonblocking: true );
> 
>   Console.WriteLine( message );
> };
> 
> // Publish a message to all subscribers.
> 
> publisher.Send( "Hello world!" );


A few things that make this sample stand out from the other two ZeroMQ C# 
libraries-

* There's no need to manage your ZeroMQ context; it's taken care of on a 
per-AppDomain basis using refcounting.
* There is no "message" object because it provides no added benefit in C#. 
Messages are simply Byte[]s, with overloads throughout the API that accept 
Strings.
* First-class support for .NET events programming, implemented using zmq_poll() 
(but that's completely transparent to the user).

I'd love some feedback. I'm just starting to use it in a project I'm working 
on, and so far it all seems to be working smoothly and at high throughput, but 
I'm releasing it as "beta" because I don't feel that it has enough real-world 
experience yet.

Alex Forster___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] sending messages to a specific peer

2010-12-20 Thread mike castleman
hello,

I have an application where the server needs to send occasional messages
to a specific peer (because the peers control individual,  distinct, and
geographically distributed hardware resources).

The obvious solution is a ZMQ_PUB/ZMQ_SUB pair with a unique topic per
client, but my understanding is that in such a case the all messages are
in fact distributed to all subscribers and the filtering happens only on
the subscriber's side. Given the network topology and limited bandwidth
of the clients in our application, this is unsuitable.

One solution which may work is to use XREP/XREQ sockets: the client sets
its identity on connect and then proceeds to ignore the usual REP/REQ
pattern in favor of just waiting for messages from the server. A minimal
implementation of this pattern (in Ruby) is at
. This seems to work, but it also seems
like an abuse of XREP/XREQ.

Any thoughts on this problem? Should I use the XREP/XREQ pattern
described here, or is there something better that I am overlooking? If
this problem is well-known and has already been discussed, then pointers
to such previous discussion would be much appreciated.

thanks a lot!

mlc

-- 
mike castleman
mailto:m...@mlcastle.net
tel:+1-646-382-7220
http://mlcastle.net/
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] FOSDEM lightning talk on ZeroMQ?

2010-12-20 Thread Pieter Hintjens
Thanks guys!
On 19 Dec 2010 22:23, "Martin Sustrik"  wrote:
> On 12/19/2010 06:14 PM, Benjamin Henrion wrote:
>
>>> Have you submitted the talk request?
>>
>> No, it is up to you to do it, I was just relaying the Pieter's request.
>
> Ok. Submitted.
>
> Martin
> ___
> zeromq-dev mailing list
> zeromq-dev@lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] Streamer Operation

2010-12-20 Thread Jeff Vienneau
Hi,

Two quick questions wrt the streamer device:

1) Can it have multiple outputs like shown below?
2) If this is allowed, will the streamer send a duplicate to each bound
output?












Thanks!
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev