[zeromq-dev] zmqpp/ZeroMQ/OpenPGM problem with latest Linux kernels

2023-01-10 Thread Alex via zeromq-dev

Hi all,
may be somebody might advice me something, at least where should I adress this 
question. We use ZeroMQ on Linux, particularly fro PGM data distribution. 
Recently I found that when CPU load on a receiver side is significant, It 
causes to multiple NAK/NCF packets and receivers dosconnect from sender. Of 
course, datarate is not low, 5...10 Mbytes/sec. The network is 1000Base-T, very 
short distances (PICMG 2.16 PSB). It wouldn't sound like a surprise if it were 
common for all versions of Linux kernel (I've tried different versions of 
Debian only). But it appears only for kernels 4+.x, with kernel 3.16 (for 
example)  PGM works fine with larger CPU load . I tried different PGM socket 
options, different Linux prioryty/niceness settings - no effect. Also I tried 
to choose different Linux schedulers for the receiver process, to increase FIFO 
buffers, to change pgm: with epgm: — no effect. Please turn me to the right 
side, where I should dig further - Linux, ZeroMQ or openPGM or where this 
question…The network load is too high to use TCP, configuration has one sender 
and 5+ receivers.
      Also it would be very interesting what major network feature came to 
Linux with 4+ kernel, which impacts OpenPGM so dramatically. I tried to google 
but have not found yet.
 
 
Thanks in advance,
Alex Tsiberev,
P.S.E.
IPFRAN
 ___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
https://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Bitcoin still using ZMQ?

2020-12-03 Thread Alex
Yes, Bitcoin still uses ZMQ.
At least, Bitcoin-Core (most common implementation) is, but some other 
implementations do not use it. I think it uses version 4.0.0 now.
When building from source it can be disabled.




‐‐‐ Original Message ‐‐‐
On Wednesday, November 25, 2020 12:00 PM,  
wrote:

> Send zeromq-dev mailing list submissions to
> zeromq-dev@lists.zeromq.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev
> or, via email, send a message with subject or body 'help' to
> zeromq-dev-requ...@lists.zeromq.org
>
> You can reach the person managing the list at
> zeromq-dev-ow...@lists.zeromq.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of zeromq-dev digest..."
>
> Today's Topics:
>
> 1.  Re: SPLASH 2020 keynote talk about ZeroMQ (Gregg Irwin)
> 2.  Bitcoin still using ZMQ? (Benjamin Henrion)
>
>
> Message: 1
> Date: Tue, 24 Nov 2020 11:06:10 -0700
> From: Gregg Irwin gr...@pointillistic.com
> To: ZeroMQ development list zeromq-dev@lists.zeromq.org
> Subject: Re: [zeromq-dev] SPLASH 2020 keynote talk about ZeroMQ
> Message-ID: 1679803453.20201124110...@pointillistic.com
>
> Content-Type: text/plain; charset=us-ascii
>
> Thanks Arnaud!
>
>
> 
>
> Message: 2
> Date: Wed, 25 Nov 2020 10:26:45 +0100
> From: Benjamin Henrion zoo...@gmail.com
> To: ZeroMQ development list zeromq-dev@lists.zeromq.org
> Subject: [zeromq-dev] Bitcoin still using ZMQ?
> Message-ID:
> CANjd3nc=sq16hrmniextbveoiz1kyfnks26sb_dnp5qnhkk...@mail.gmail.com
>
> Content-Type: text/plain; charset="UTF-8"
>
> Hi,
>
> Can someone confirm if Bitcoin is still using zeromq?
>
> Best,
>
> -
>
> Benjamin Henrion (zoobab)
> Email: zoobab at gmail.com
> Mobile: +32-484-566109
> Web: http://www.zoobab.com
> FFII.org Brussels
> "In July 2005, after several failed attempts to legalise software
> patents in Europe, the patent establishment changed its strategy.
> Instead of explicitly seeking to sanction the patentability of
> software, they are now seeking to create a central European patent
> court, which would establish and enforce patentability rules in their
> favor, without any possibility of correction by competing courts or
> democratically elected legislators."
>
>
> ---
>
> Subject: Digest Footer
>
> zeromq-dev mailing list
> zeromq-dev@lists.zeromq.org
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
> --
>
> End of zeromq-dev Digest, Vol 56, Issue 10


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


Re: [zeromq-dev] decentralize git with pub/sub

2019-07-29 Thread alex.
Alas, "hosting yourself" is a murky concept:
- Do you run your service on a virtual server? Then who hosts your vServer?
- Do you run your service on bare metal? Then who hosts your datacenter,
where the metal is located?
- Do you run your bare metal on your own internet connection? Then who
is your provider?

The fact of the matter is is that there is no jurisdiction-free
cyberspace and moreover the jurisdictions of independent countries do
slowly catch up to the technology. And such a debate is pointless
anyway. It's also not the question at hand.

So let's get back to the initial question: a decentralized git. The fact
of the matter is is that git is a decentralized protocol. The irony of
the matter is is that a lot of platforms spruced up leveraging git,
adding incredible features - but being centralized. If C4 requires bug
tracking and pull requests, then that is a problem for decentralization.

However, it should be possible to make those platforms work in a
decentralized manner. I.e. multiple entry-points for submitting, polling
and reviewing. Note though that a decentralized infrastructure always
comes at increased maintenance costs. Plus the development cost. But
that's one option.

Another option is we look into free (as in freedom and in beer) hosting
alternatives outside of the US, e.g. in a EU-based datacenter. While "if
a foreign company does business with US businesses but also Iranian
businesses, it is a target of those US sanctions" is true, it's also
true that the EU plans to reimburse that EU-based company's losses so as
to nullify these sanctions.

In any case, ZeroMQ is not the only dev project having these problems.
Communication, concertation and solidarity is key here.

alex.

On 7/29/19 7:26 AM, Esa HekmatiZadeh wrote:
> I checked gitlab service today and yes, gitlab also prevent Iranian access. 
> I'm not familliar with email based patching and development in this
> style, also I think C4 requires bug tracking and pull request mechanism. 
> Harald is right and if you host gitlab yourself then you are free from
> rules of hosting services. 
> It's not a matter if this host located in US, until it doesn't have any
> trade. Like Savanneh service
> 
> 
> On Mon, 29 Jul 2019, 03:02 Harald Achitz,  <mailto:harald.ach...@gmail.com>> wrote:
> 
> I think when you run gilab your own, you can run it on whatever
> server you want in any country, and can allow access to whom ever
> you want
> of course, for free hosting you need to follow the rules of the one
> who does the hosting for you
> 
> so there are 2 aspects, the git software, which is git,
> usermanangment, issue tracker, etc...,
> github gitlab bitbucket gitteaGogs,  the list is rather long
> 
> and the git software hosting, where some have the same name as their
> produces, github gitlab bitbucket,
> so there are companies that provide a hosting service and of you use
> their services and you have to follow the rules of them
> 
> https://git.wiki.kernel.org/index.php/GitHosting
> 
> the problem is, if there is no financial baking, and you are
> depended on free services , the non US options seem to be limited
> 
> I heard / read that kernel devs still use mail ...
> 
>  
> 
> 
> 
>  
> 
> 
> 
> 
> Am So., 28. Juli 2019 um 22:02 Uhr schrieb Benjamin Henrion
> mailto:zoo...@gmail.com>>:
> 
> On Sun, Jul 28, 2019 at 8:48 PM Esa HekmatiZadeh
> mailto:esa.hek...@gmail.com>> wrote:
> >
> > Hi Benjamin
> > Thank you to mention this issue here, actually yesterday
> GitHub suspended my account because I live in Iran. There are a
> long list of platforms and even free software websites that are
> forbidden for countries you have mentioned and I think this is
> completely against freedom.
> 
> I just moved myself to Iran for Github software development:
> 
> https://github.com/zoobab
> 
> > Gitlab does not ban users from these countries yet, also
> GItlab is GPL licensed and we can host it ourself in a
> subdomain, for example, gitlab.zeromq.org
> <http://gitlab.zeromq.org> but this approach requires extra
> maintenance and a server to run Gitlab.
> 
> It seems Gitlab.com is also based in the US.
> 
> > https://savannah.nongnu.org/ is another option hosted by FSF
> foundation.
> 
> Hosted in Fremont, CA, United States.
> 
> As long as the US has jurisdiction, you are lost.
> 
> I was looking for friendly countries that do not have trade
> sanctions
> with Iran, it seems the US 

[zeromq-dev] Java implementation

2018-11-19 Thread Alex
Hi 

Is there an existing ZeroMQ Java implementation that supports UDP multicast?

Best regards,
 
 Alex
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
https://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] zeromq / pub sub lost messages

2017-01-04 Thread alex.
The publisher does not know when a subscriber congests, as the pub-sub
pattern is stateless in that regard.

What you could do is to check which message was the last one received at
the subscriber and request all messages from that message onwards from
the publisher. However, that requires a separate connection to the
publisher.

The pub-sub-pattern is mostly only a viable option when the subscriber
is able to work even if it doesn't receive all messages. If your usecase
does not allow that you might be better of using another pattern, like
req-rep or broker.

Best,
alex.

On 04.01.2017 10:43, Philippe Guibert wrote:
> On Wed, Jan 4, 2017 at 10:34 AM, Jens Auer <jens.a...@betaversion.net> wrote:
> 
> Hello Jens,
> 
> Best wishes too,
> 
>> Hi,
>>
>>
>>
>> how do you send the messages?
> 
> I use zmq_msg_send() procedure.
> I also used zmq_send() procedure with and without MSG_NO_WAIT flag.
> I expect that return code sends me an error when dropping message,
> which is not the case.
> 
>> The default HWM is 1000 messages and sending
> 
> I used tcp transport connection, and wireshark. I observed that the
> packets number sent was matching the received messages on the
> subscriber side.
> I deduced the problem was due to an emission problem, not a reception problem.
> 
> I did a counter test by setting ZMQ_SNDHWM to a big value ( in my case 6).
> I could observe no drops with both ipc and tcp transport connection.
> 
>> is done asynchronously in the IO thread. If you exceed this number of
>> messages in the queue, e.g. by sending a batch of much more than 1000
>> messages you will experience message drop.
> 
> How can I know there are some drop messages ?
> If I make a limitation, I expect to handle the flow congestion, in
> order to resubmit to publisher, but it seems publisher does not return
> me valuable error code.
> 
> Best Regards,
> 
> Philippe
> 
>>
>>
>>
>> Best wishes,
>>
>> Jens
>>
>>
>>
>> Von: zeromq-dev [mailto:zeromq-dev-boun...@lists.zeromq.org] Im Auftrag von
>> Philippe Guibert
>> Gesendet: Mittwoch, 4. Januar 2017 06:51
>> An: zeromq-dev@lists.zeromq.org
>> Betreff: [zeromq-dev] zeromq / pub sub lost messages
>>
>>
>>
>> Hi all,
>>
>> I am using zeromq 4.1.3 version through PUB/SUB operation.
>>
>> Some information about the way it is implemented:
>>
>> - It uses one single PUB application, and single SUB application, in
>> separate process.
>>
>> - Underlying Transport layer is IPC ( I am on the same machine).
>>
>> - I checked that subscription is done far before the first publication
>> message is sent.
>>
>> - Message carried are 120 byte size.
>>
>> - I use zmq_msg_recv() in reception and zmq_msg_send() in transmission.
>>
>> - I check for return code on both sides.
>>
>> I have one PUB application that sends several thousand of messages per
>> second, and I expect that the SUB application will receive all messages.
>>
>> The observation is that while the publisher sends 15000 messages, the
>> subscriber can receive sometimes 15000, but other times 14750, or 11000. It
>> does not seem to be deterministic.
>>
>> I have no error codes related to the zmq_msg_recv() or zmq_msg_send() API.
>>
>> Do you have any suggestions to give on how to handle that issue ?
>>
>> Do you suggest to use pgm protocol instead of ipc ?
>>
>> Are there any tracked issues related to that issue described ?
>>
>> Thanks in advance for any suggestion,
>>
>> Best Regards,
>>
>> Philippe
>>
>>
>> ___
>> zeromq-dev mailing list
>> zeromq-dev@lists.zeromq.org
>> https://lists.zeromq.org/mailman/listinfo/zeromq-dev
> ___
> zeromq-dev mailing list
> zeromq-dev@lists.zeromq.org
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev
> 
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
https://lists.zeromq.org/mailman/listinfo/zeromq-dev

Re: [zeromq-dev] OpenSSH replacement with zeromq

2016-12-20 Thread alex.
Indeed, talking to groups of servers + discovery would be the features
I'd want in an OpenSSH replacement.

For crypto, do go for the (native) CurveZMQ route, as in the end it
boils down to placing the public key of your machine on the servers. The
CurveZMQ (and the CurveCP project from which it is basically forked off)
are very neat crypto protocols and, when used correctly, gives pretty
good security.

Also check up on Salt[1], as it can already basically be used as a
distributed OpenSSH replacement.

[1]: https://docs.saltstack.com/en/latest/

On 20.12.2016 12:08, Kevin Sapper wrote:
> I like it! 
> 
> Though I would not drop the zyre dependency as sending commands to a
> group of servers and discovery are neat features for a ssh system IMO.
> 
> //Kevin
> 
> On Di, Dez 20, 2016 at 11:27 , Luca Boccassi 
> wrote:
>> On Tue, 2016-12-20 at 10:31 +0100, Benjamin Henrion wrote:
>>
>> Hi, Last year I worked with Pieter on the glard, a zyre daemon to
>> send commands to multiple devices on the LAN. We made a demo kit
>> with multiple openwrt routers with some bike lamps to show the
>> concept: https://github.com/CodeJockey/glar150 Now my idea was to
>> fork the tool and make it a simple OpenSSH replacement. I don't
>> know how it easy it is to add encryption keys. We could also think
>> about removing the GPIO LEDs and Zyre support in Glard and treat
>> it as a simple remote command executor. What do you think? 
>>
>> Sounds like an interesting hackaton project! :-) For encryption,
>> adding support for curve would probably be the safest and simplest
>> thing I guess? For zgossip based setups at least, as zbeacon is pure
>> UDP Kind regards, Luca Boccassi
>> ___ zeromq-dev mailing
>> list zeromq-dev@lists.zeromq.org 
>> https://lists.zeromq.org/mailman/listinfo/zeromq-dev
> 
> 
> ___
> zeromq-dev mailing list
> zeromq-dev@lists.zeromq.org
> https://lists.zeromq.org/mailman/listinfo/zeromq-dev
> 
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
https://lists.zeromq.org/mailman/listinfo/zeromq-dev

Re: [zeromq-dev] ZeroMQ Curve Publish Subscribe

2016-10-13 Thread alex.
Hi Roy,

it seems you are convoluting how ZeroMQ and CurveMQ work. ZMQ simply
abstracts how clients talk over a network. Pub-Sub is a fine example of
that since you, as a developer can write programs where clients can
fan-out messages, i.e. from one node to many others in one direction.
This does not mean, however, that this is what actually happens. In
fact, ZMQ opens as many (bidirectional) TCP connections between the
publisher and all the subscribers and sends pretty much the same message
from the publisher to all the subscribers, each in its own connection.

What this means for encryption is that the high-level message you send
is actually encrypted with the public key of each subscriber and then
sent individually. In fact, a single subscriber could never decrypt a
message that was sent to another subscriber.

TL;DR it just _seems_ as though the publisher is "encrypting" the
message once with his private key, but in fact the message is encrypted
as many times as there are subscribers.

Cheers!
alex.

On 13.10.2016 08:59, LENFERINK Roy wrote:
> Hello everyone,
> 
>  
> 
> Currently I’m investigating the possibilities of ZeroMQ.
> 
>  
> 
> At the moment, I have created a publisher subscribe system with curve
> enabled.
> 
>  
> 
> This is the code I used to get it up and running (got it from Pieter
> hintjes his blog):
> 
> http://pastebin.com/LjV8aKLG
> 
>  
> 
> At the moment, the publisher is encrypting data with his private key and
> 
> different subscribers can decrypt the data using the publishers public key.
> 
> This is more ‘authenticating’ data than ‘encrypting’ data.
> 
>  
> 
> I would like to swap the keys, so, the publisher should encrypt the data
> 
> with his public key, and the subscribers should decrypt the data using
> 
> the private key of the publisher.
> 
>  
> 
> I have tested it with just loading the public key into the publishers
> program
> 
> and then load the private key into the subscribers program and apply
> this key to the
> 
> subscribers socket, but this is constantly giving me a message:
> 
> “CURVE I: cannot open client HELLO – wrong server key?”
> 
>  
> 
> Is it possible to use a public key for encrypting data (publisher
> socket) and
> 
> the private key for decrypting data (subscriber socket) with the
> architecture of ZeroMQ ?
> 
>  
> 
> Many thanks in advance,
> 
> Roy
> 
> 
> Disclaimer:
> 
> If you are not the intended recipient of this email, please notify the sender 
> and
> delete it. 
> Any unauthorized copying, disclosure or distribution of this email or its
> attachment(s) is forbidden. 
> Thales Nederland BV will not accept liability for any damage caused by this 
> email or
> its attachment(s). 
> Thales Nederland BV is seated in Hengelo and is registered at the Chamber of
> Commerce under number 06061578.
> 
> 
> 
> 
> ___
> 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

Re: [zeromq-dev] nomenclature

2016-08-26 Thread alex.

Hi Andrew,

I have to agree with Pieter here. What you want to be thinking about is: 
What data should be where? And what shall happen with it when it is there?


I feel this is what you also want to do, but I think Pieter is right in 
pointing out that thinking about all possible data flow is a mistake, 
and protocols are a better vantage point. The problem, imho, is briefly: 
"data flow" encompasses all possible events in your system, protocols 
define only what events are legal in your system.


To use your analogy: The national highway system in Germany isn't 
greatly defined (with it's countless driveways, reststops, roadworks, 
etc.), and I don't suppose any one person in Germany knows *all* about 
it, let alone know how all vehicles behave at any one point in time on 
the highway system. However, the law on traffic in Germany (STVO) is 
still just 53 paragraphs long and only one of them (§18) is concerned 
specifically about highways. Still, our highway system works, everday, 
with all the countless vehicles driving there every day. I'd say the 
STVO scaled extremely well!


And here is the interesting part: In almost all cases accidents aren't 
faults of the driving rules, but of the drivers not upholding the rules. 
As a computer scientist, you could say that bad drivers are the bugs of 
the road system. And for the few cases where your protocol was faulty, 
you only have to change one or two sentences in your law/protocol (not 
all the drivers).


So I would also recommend to you to not think about all the moving parts 
in all their possible configurations (i.e. all the cars on the road), 
but to really boil it down to: What data should be where? And how should 
receivers of that data respond to it? That is, write a protocol.


Best,
alex.

P.S. This is also why I came to love finite state machines: as they 
translate your protocol-law perfectly into code.


Am 25.08.2016 um 21:36 schrieb Andrew Hume:

pieter,

i can’t figure out what you’re saying here. based on my several years 
experience
with you, i have to conclude that i have somehow misspoken.

i have a distributed application. that is, there are a number of 
discrete components
that (for this discussion) are distinct processes running on some number of 
servers.
some are accessed thru RPC calls, others generate work that then processed by
some number of worker components.

in order for this to work, i clearly need to figure out how data will 
flow
through this system. as i have understood the design methodology around zeromq,
this means figuring out the fixed points in the data flow and organising the
components around those fixed points. some of these allow for “scaling”
(as in increasing the size of a worker pool).

so i don’t understand
1) how can this sort of design be a “mistake”? how can you do anything without
(trying to) understand where the data needs to go?

2) many protocols (which i guess you mean things defined by RFCs) don’t scale;
they simply detail teh bi-lateral contract between (roughly) user and supplier 
of a service
(like NTP). i know some address this directly (like the Gossip protocol), but 
surely you don’t mean just those?

andrew



On Aug 24, 2016, at 11:06 AM, Pieter Hintjens <p...@imatix.com> wrote:

FWIW I have come to believe that trying to design or even understand
the overall flows of data is a mistake, at least when you want to
scale.

What does scale is to speak of protocols and implementations. I know
this isn't a happy answer yet it's a proven one (RFCs, Internet).

___
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 mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Re: [zeromq-dev] Polling issue. Socket blocking on SendMessage

2016-08-04 Thread alex.
Yes. In ZMQ the send operation is blocking until the message could be
queued to the socket[1]. Not however that the socket in question is the
sending socket not the receiving one. The sending Dealer-Socket is
itself supposed to block once its High-Water-Mark has been reached due
to no receiving sockets being available[2].

You can however add the ZMQ_NOBLOCK flag to the send operation that does
not block but sets the errno integer to EAGAIN (afaik you can also check
the returned integer of zmq_send())[1]. In that case the Dealer-Socket
would still reach its HWM but the send operation would not block.
However that's probably not what you want ;). Still wanted to share that
detail.

Best,
alex.


[1]: http://api.zeromq.org/2-1:zmq-send
[2]: http://api.zeromq.org/2-1:zmq-socket#toc6

On 03.08.2016 18:44, Tobias Elbert wrote:
> Actually I think I just answered my own question:
> 
> 
> In my case the socket is connected on a virtual VPN adapter and the VPN
> is still a bit flaky. We're still in the process of setting that up
> properly and I think what happened was that the VPN server machine went
> into hibernation so the sending socket's endpoint was no longer
> available. From memory this lines up time-wise with the other incidents
> I have mentioned (VPN going down and the socket blocking).
> 
> 
> I suppose default behaviour also for Dealer sockets is to block and wait
> until the endpoint becomes available again rather than enqueue on its
> internal message queue?
> 
> 
> Thanks
> 
> Tobias
> 
> 
> 
> 
> *From:* zeromq-dev <zeromq-dev-boun...@lists.zeromq.org> on behalf of
> Tobias Elbert <tobias_elb...@hotmail.com>
> *Sent:* Wednesday, August 3, 2016 5:18 PM
> *To:* zeromq-dev@lists.zeromq.org
> *Subject:* [zeromq-dev] Polling issue. Socket blocking on SendMessage
>  
> 
> Hi all,
> 
> I am having an issue with a setup similar to the sample in the Pastebin
> link provided below. Basically I let the poller block for 2 seconds and
> every 6 seconds send out a heartbeat from within the polling loop. My
> understanding is that while I’m in the polling loop that it is safe to
> do sends/ receives on any of the sockets on the poller. 
> 
> This works fine for a few hours but after 2-3 hours (sometimes can also
> go for a whole day without issues). I put a fully functioning sample on
> Pastebin:
> 
> http://pastebin.com/diN8ymmD
> <http://pastebin.com/diN8ymmD>
>   
> [C#] C# Bindings. Polling issue. Socket blocking on SendMessage -
> Pastebin.com <http://pastebin.com/diN8ymmD>
> pastebin.com
> 
> 
> 
> For clarity, here the piece of code where the SendMessage call blocks
> indefinitely:
> 
> while(true)
> {
> poller.Poll(TimeSpan.FromSeconds(2));
> 
> if ((DateTime.UtcNow - lastHeartbeat).TotalSeconds > 5)
> {
> ZmqMessage hbMessage = new ZmqMessage();
> 
> hbMessage.Append(Encoding.ASCII.GetBytes(HeartBeatMsg));
> 
> Console.WriteLine("About to send Heartbeat {0}", DateTime.Now);
> // blocks here after a while:
> frontend.SendMessage(hbMessage); // blocks here
> 
> Console.WriteLine("Sent Heartbeat {0}", DateTime.Now);
> 
> lastHeartbeat = DateTime.UtcNow;
> }
> }
> 
> Note I am using v3.2.5 libzmq and its corresponding C# bindings. 
> 
> 
> Any input would be appreciated.
> 
> Thanks Tobias.
> 
> 
> 
> 
> ___
> 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

Re: [zeromq-dev] Erlang implementation of ZMTP 3.1

2016-06-29 Thread Alex Bligh

On 29 Jun 2016, at 01:21, Andriy Drozdyuk <dro...@gmail.com> wrote:

> Interesting. I'm not married to AGPL, just don't want companies hogging any 
> patches they made.

I'm not an Erlang user, but if I needed bindings for a language and
I saw an AGPL licence, I'd write my own bindings and release them
with a BSD licence - I'd do that whether I was writing something
open source or commercial. LGPL might fly if all you're worried
about is ensuring patches to the project get recycled.

Alex

> 
> On Tue, 28 Jun 2016 at 16:28 Pieter Hintjens <p...@imatix.com> wrote:
> This is really cool.
> 
> The license choice will IMO hinder community growth around the project
> so I'd advise to you have a backup plan to switch to MPLv2 if the
> commercial uptake isn't sufficient.
> 
> On Tue, Jun 28, 2016 at 7:09 PM, Andriy Drozdyuk <dro...@gmail.com> wrote:
> > At Pieter's suggestion, I am putting this here:
> > https://github.com/chovencorp/erlangzmq
> >
> > Native erlang 18 implementation of ZMTP 3.1 (including resource property),
> > but without any security.
> >
> > Hopefully it will be useful to people. I know I'll use it myself - since all
> > (native) erlang bindings are out of date.
> >
> > This is a six month young project, so this is NOT performance or otherwise
> > tested at all, and I would appreciate any feedback (just take a second to
> > file an issue).
> >
> > Thank you,
> > --Andriy Drozdyuk
> >
> > ___
> > 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 mailing list
> zeromq-dev@lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev

-- 
Alex Bligh




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

Re: [zeromq-dev] Moving list to Google groups?

2016-04-15 Thread alex.
I have to take back my vote for librelist. By chance I read some Mails 
from Flask (a python web-framework) which used to host their 
mailing-lists there and decided to move to mail.python.org. Turns out 
librelist didn't use mailman and some users were unable to subscribe to 
the list, while Zed Shaw seems to have abandoned his librelist project.[1]

So bugs, non-conventional software and halting development throws 
librelist out of the race.

Another thing: Personally I couldn't find a mailman hoster that's free 
for opensource projects. Unless you'd count riseup.[2]

[1]: 
http://librelist.com/browser//flask/2015/7/14/switch-mailing-list-software-away-from-librelist/
[2]: https://lists.riseup.net/

Am 14.04.2016 um 11:54 schrieb alex.:
> Also a 'nay' on Google Groups from me.
>
> And I also concur with Lionel Orry: Librelist is just awesome.
> Personally I've had the best mailing list experience with lists hosted
> their - although that might just say something about the quality of the
> projects hosted there.
>
> Afaik it also uses mailman and from their help page as a list owner you
> seem to have good access to archive data, so porting them over is
> probably easily doable. But you can simply send an E-Mail to
> m...@librelist.com and ask, the guy running the show is really nice.
>
> best,
> alex.
>
> On 14.04.2016 09:41, Pieter Hintjens wrote:
>> So an added criteria for any new platform is ability to import our archives.
>>
>> Free is a plus iff the hosting business is long term reliable.
>>
>> Conventional email interface is a plus.
>>
>>
>> On Thu, Apr 14, 2016 at 9:36 AM, Indradhanush Gupta
>> <indradhanush.gu...@gmail.com> wrote:
>>>
>>>
>>> On Thu, Apr 14, 2016 at 1:02 PM, Jim Idle <j...@temporal-wave.com> wrote:
>>>>
>>>> Also usually a lurker here, but I am all in favor of Google Groups.
>>>> Generally much better than the mailing list software. Can be a change for
>>>> some people of course. But +1 from me for what it's worth.
>>>>
>>>> Jim
>>>>
>>>> On Thu, Apr 14, 2016 at 3:05 PM, Dinu Gherman
>>>> <gher...@darwin.in-berlin.de> wrote:
>>>>>
>>>>> Hi!
>>>>>
>>>>> I'm a silent lurker here, but I would most likely stop following this
>>>>> list after a move to google groups.
>>>
>>>
>>> Agree with Dinu here. I'll probably forget about the list on google groups.
>>>
>>>>>
>>>>> I don't like imposing the use of an account already connecting to lots of
>>>>> data where any email address anywhere would be just what is needed. Sure,
>>>>> you can user other identities, but that's a pain.
>>>>>
>>>>> Unrelated to ideology, I've tried using google groups for other groups
>>>>> imposing it on their members and I did not like the "user experience" at
>>>>> all, and after a while I gave up. I don't understand how people can like 
>>>>> it.
>>>>> If it would be more like google mail, I
>>>>> might like it.
>>>>>
>>>>> I would give Mailman 3 a try which should now have an interface decades
>>>>> better than Mailman 2, which is probably literally true if you skip the
>>>>> plural s.
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Dinu
>>>>>
>>>>> --
>>>>> Sent on the move.
>>>>> Von unterwegs gesendet.
>>>>>
>>>>>> Am 14.04.2016 um 00:45 schrieb Pieter Hintjens <p...@imatix.com>:
>>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> I'd like to raise this question for discussion. The problem is that
>>>>>> zeromq-dev is running on an iMatix server, and I'd like to remove
>>>>>> iMatix infrastructure from our community, over time. It's a matter of
>>>>>> long term sustainability.
>>>>>>
>>>>>> (Apart from the list, iMatix also hosts downloads.zeromq.org which we
>>>>>> can start to move to Github release attachments IMO.)
>>>>>>
>>>>>> Anyhow, re. lists, let's weigh pros and cons of Google groups versus
>>>>>> other options. I'll make the decision based on this thread and other
>>>>>> factors.
>>>>>>
>>>>>> Thanks
>>>>>> Pieter
>>>>>> _

Re: [zeromq-dev] Using GSL to design an FSM protocol and translate it into a CSP protocol

2016-04-14 Thread alex.
Thanks Bjorn,

that seems exactly like what I was looking for. And if I do it
correctly, I should be able to get a GSL template working that
translates (simple) FSMs into TLA+. If I ever come to that stage I'd be
glad to share it.

Seems kinda cool in my head: building nice networking protocols with
GSL, ready to be integrated into ZeroMQ with zproto, and checked for
validity and security by the TLA toolbox.

Well, we'll see.
Best,
alex.

On 14.04.2016 12:21, Bjorn Reese wrote:
> On 04/14/2016 11:30 AM, alex. wrote:
> 
>> Anyway after doing a little more research some papers indicated that a
>> better approach for writing communication protocols would be
>> communicating sequential processes (CSP). But they are somewhat of an
>> antithesis to FSMs: their basic elements are processes whereas in FSMs
>> the basic elements are states. Now I could brush CSPs aside and just go
> 
> You may want to look into Lamport's TLA+.
> 
> ___
> 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


Re: [zeromq-dev] Moving list to Google groups?

2016-04-14 Thread Alex Bligh

On 14 Apr 2016, at 08:41, Pieter Hintjens <p...@imatix.com> wrote:

> So an added criteria for any new platform is ability to import our archives.
> 
> Free is a plus iff the hosting business is long term reliable.
> 
> Conventional email interface is a plus.

Additional criterion (satisfied by Google Groups and many others): spam
resistance.

Lists at sourceforge that I'm on have more spam than genuine messages.
So don't go there please.

-- 
Alex Bligh




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


Re: [zeromq-dev] Using GSL to design an FSM protocol and translate it into a CSP protocol

2016-04-14 Thread alex.
Haha, yeah I was expecting no one would understand my request. The
troubles of being short and concise. I also forgot to include the links
I had prepared. :(

So as a short explanation, communicating sequential processes is a model
developed by Tony Hoare in 1978 which is sort of like state machines,
but well different.[3] One book about protocol design I have open right
now is from Robin Sharp "Principles of Protocol Design" (2008) implies
that CSPs have "gained prominence within recent years" because basically
FSMs suck for parallel operations.

Again, I want to use GSL to start off both the protocol and my codebase
using state machines (so big thanks for the links Pieter and Kevin!).
But if it'll be possible to generate a CSP style protocol using GSL from
my state machine, I'd be enormously happy.

Thus my questions: Did anyone ever try something like this remotely?

Best,
alex.


P.S. The links:
[1]: http://www.cs.ox.ac.uk/gavin.lowe/Security/Casper/
[2]: https://www.cs.ox.ac.uk/projects/fdr/
[3]: https://en.wikipedia.org/wiki/Communicating_sequential_processes

On 14.04.2016 11:37, Pieter Hintjens wrote:
> I don't understand half of what you're asking :) But in any case do
> take a look at the tiny FSM / C code generator
> (https://github.com/imatix/gsl/blob/b0aa393a6d00df2859f21aab0ccf6f203e18db96/examples/fsm_c.gsl)
> that I've used happily in a few projects already.
> 
> On Thu, Apr 14, 2016 at 11:30 AM, alex. <thissid...@riseup.net> wrote:
>> First of all I wasn't really sure if it's okay to talk about the GSL
>> Universal Code Generator on this list, but I am writing anyway since it
>> didn't have its own mailing list. So forgive any insolence. :)
>>
>>
>> I was planning on writing my thesis about a traffic analysis resistant
>> multi-user file-transfer protocol and sure enough I wanted to do the
>> proof-of-concept implementation using ZeroMQ (so, yeah, expect to hear
>> more from me over the next months ;) ). Now I haven't ever written a
>> protocol myself but from the (little) research I did, I came to the
>> conclusion that it would be best to formalize it as best as possible, in
>> particular preventing any indeterminism. So the first idea was to use
>> finite state machines for formalization and for some reason the best
>> tool I could find for writing finite state machines that also lets me
>> write test cases AND generate all kinds of code (including graphics and
>> C-bindings) was made by the same people who created ZeroMQ. What about
>> that, I thought to myself.
>>
>> Anyway after doing a little more research some papers indicated that a
>> better approach for writing communication protocols would be
>> communicating sequential processes (CSP). But they are somewhat of an
>> antithesis to FSMs: their basic elements are processes whereas in FSMs
>> the basic elements are states. Now I could brush CSPs aside and just go
>> for FSMs, but since my thesis is mostly security/cryptography related, I
>> also looked for security protocol analysers and every tool I could find
>> was using CSPs as well. In particular I found Casper[1], which uses a
>> special kind of CSP syntax to generate formalized CSP to be then checked
>> with FDR3[2].
>>
>> In short, the scenario I would love to go for is basically:
>> - writing FSM in iMatix' GSL syntax,
>> - compile it to Casper's CSP syntax,
>> - compile that to general CSP to be checked by FDR3.
>>
>>
>> My question to this fine community is thus: Did anyone ever try to
>> produce a CSP using the GSL Universal Code Generator? Is something like
>> that even achievable (without wasting large amounts of precious time)
>> using GSL?
>> Or in general, did anyone ever try to translate FSMs into CSPs? Or am I
>> just too uninformed to know that something like this is simply absurd?
>>
>> All the best,
>> alex.
>> ___
>> 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 mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Moving list to Google groups?

2016-04-14 Thread alex.
Also a 'nay' on Google Groups from me.

And I also concur with Lionel Orry: Librelist is just awesome.
Personally I've had the best mailing list experience with lists hosted
their - although that might just say something about the quality of the
projects hosted there.

Afaik it also uses mailman and from their help page as a list owner you
seem to have good access to archive data, so porting them over is
probably easily doable. But you can simply send an E-Mail to
m...@librelist.com and ask, the guy running the show is really nice.

best,
alex.

On 14.04.2016 09:41, Pieter Hintjens wrote:
> So an added criteria for any new platform is ability to import our archives.
> 
> Free is a plus iff the hosting business is long term reliable.
> 
> Conventional email interface is a plus.
> 
> 
> On Thu, Apr 14, 2016 at 9:36 AM, Indradhanush Gupta
> <indradhanush.gu...@gmail.com> wrote:
>>
>>
>> On Thu, Apr 14, 2016 at 1:02 PM, Jim Idle <j...@temporal-wave.com> wrote:
>>>
>>> Also usually a lurker here, but I am all in favor of Google Groups.
>>> Generally much better than the mailing list software. Can be a change for
>>> some people of course. But +1 from me for what it's worth.
>>>
>>> Jim
>>>
>>> On Thu, Apr 14, 2016 at 3:05 PM, Dinu Gherman
>>> <gher...@darwin.in-berlin.de> wrote:
>>>>
>>>> Hi!
>>>>
>>>> I'm a silent lurker here, but I would most likely stop following this
>>>> list after a move to google groups.
>>
>>
>> Agree with Dinu here. I'll probably forget about the list on google groups.
>>
>>>>
>>>> I don't like imposing the use of an account already connecting to lots of
>>>> data where any email address anywhere would be just what is needed. Sure,
>>>> you can user other identities, but that's a pain.
>>>>
>>>> Unrelated to ideology, I've tried using google groups for other groups
>>>> imposing it on their members and I did not like the "user experience" at
>>>> all, and after a while I gave up. I don't understand how people can like 
>>>> it.
>>>> If it would be more like google mail, I
>>>> might like it.
>>>>
>>>> I would give Mailman 3 a try which should now have an interface decades
>>>> better than Mailman 2, which is probably literally true if you skip the
>>>> plural s.
>>>>
>>>> Cheers,
>>>>
>>>> Dinu
>>>>
>>>> --
>>>> Sent on the move.
>>>> Von unterwegs gesendet.
>>>>
>>>>> Am 14.04.2016 um 00:45 schrieb Pieter Hintjens <p...@imatix.com>:
>>>>>
>>>>> Hi all,
>>>>>
>>>>> I'd like to raise this question for discussion. The problem is that
>>>>> zeromq-dev is running on an iMatix server, and I'd like to remove
>>>>> iMatix infrastructure from our community, over time. It's a matter of
>>>>> long term sustainability.
>>>>>
>>>>> (Apart from the list, iMatix also hosts downloads.zeromq.org which we
>>>>> can start to move to Github release attachments IMO.)
>>>>>
>>>>> Anyhow, re. lists, let's weigh pros and cons of Google groups versus
>>>>> other options. I'll make the decision based on this thread and other
>>>>> factors.
>>>>>
>>>>> Thanks
>>>>> Pieter
>>>>> ___
>>>>> 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 mailing list
>>> zeromq-dev@lists.zeromq.org
>>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>>
>>
>>
>>
>> --
>> Indradhanush Gupta
>>
>>
>> ___
>> 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 mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Moving list to Google groups?

2016-04-14 Thread Alex Bligh

On 14 Apr 2016, at 10:46, Jeff Shanab <jsha...@jfs-tech.com> wrote:

> I am also a mostly silent lurker and will probably not follow a google group. 
> :-(  

I've no particular beef for or against Google Groups, but it is entirely 
possible
to follow them like a normal mailing list. The signup feature is hidden a 
little,
but you can get it to send every message to your by email, and you can reply by
email. I participate in several lists that work this way (the raft mailing
list being an example off the top of my head).

The main problem is that if most people use the Google Groups interface, a lot
of them seem to reply trimming all context, which makes following conversations
hard.

-- 
Alex Bligh




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


[zeromq-dev] Using GSL to design an FSM protocol and translate it into a CSP protocol

2016-04-14 Thread alex.
First of all I wasn't really sure if it's okay to talk about the GSL
Universal Code Generator on this list, but I am writing anyway since it
didn't have its own mailing list. So forgive any insolence. :)


I was planning on writing my thesis about a traffic analysis resistant
multi-user file-transfer protocol and sure enough I wanted to do the
proof-of-concept implementation using ZeroMQ (so, yeah, expect to hear
more from me over the next months ;) ). Now I haven't ever written a
protocol myself but from the (little) research I did, I came to the
conclusion that it would be best to formalize it as best as possible, in
particular preventing any indeterminism. So the first idea was to use
finite state machines for formalization and for some reason the best
tool I could find for writing finite state machines that also lets me
write test cases AND generate all kinds of code (including graphics and
C-bindings) was made by the same people who created ZeroMQ. What about
that, I thought to myself.

Anyway after doing a little more research some papers indicated that a
better approach for writing communication protocols would be
communicating sequential processes (CSP). But they are somewhat of an
antithesis to FSMs: their basic elements are processes whereas in FSMs
the basic elements are states. Now I could brush CSPs aside and just go
for FSMs, but since my thesis is mostly security/cryptography related, I
also looked for security protocol analysers and every tool I could find
was using CSPs as well. In particular I found Casper[1], which uses a
special kind of CSP syntax to generate formalized CSP to be then checked
with FDR3[2].

In short, the scenario I would love to go for is basically:
- writing FSM in iMatix' GSL syntax,
- compile it to Casper's CSP syntax,
- compile that to general CSP to be checked by FDR3.


My question to this fine community is thus: Did anyone ever try to
produce a CSP using the GSL Universal Code Generator? Is something like
that even achievable (without wasting large amounts of precious time)
using GSL?
Or in general, did anyone ever try to translate FSMs into CSPs? Or am I
just too uninformed to know that something like this is simply absurd?

All the best,
alex.
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Packet ordering in RTR->DLR chains

2016-03-18 Thread Alex Bligh
Any ideas on this one?

Alex

On 14 Mar 2016, at 16:58, Alex Bligh <a...@alex.org.uk> wrote:

> If messages are transmitted through chains of RTR->DLR from A to Z, and it is 
> guaranteed the intervening application code does not reorder the packets, is 
> it guaranteed that ZeroMQ will also not reorder the messages? IE if my 
> message path does not change, am I guaranteed messages between A and Z will 
> continue to be ordered? Obviously this is the case for REQ->...->REP chains, 
> but what about RTR->DLR->RTR->DLR (for example) chains where there may be 
> more than one message in flight at once?
> 
> -- 
> Alex Bligh
> 
> 
> 
> 

-- 
Alex Bligh




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


[zeromq-dev] Packet ordering in RTR->DLR chains

2016-03-14 Thread Alex Bligh
If messages are transmitted through chains of RTR->DLR from A to Z, and it is 
guaranteed the intervening application code does not reorder the packets, is it 
guaranteed that ZeroMQ will also not reorder the messages? IE if my message 
path does not change, am I guaranteed messages between A and Z will continue to 
be ordered? Obviously this is the case for REQ->...->REP chains, but what about 
RTR->DLR->RTR->DLR (for example) chains where there may be more than one 
message in flight at once?

-- 
Alex Bligh




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


Re: [zeromq-dev] Thread safe Pub/Sub and Multicast

2016-03-12 Thread Alex Bligh

On 12 Mar 2016, at 01:00, Doron Somech <somdo...@gmail.com> wrote:

> During the ZeroMQ hackathon I have added the Radio/Dish pattern (thread safe 
> version of pubsub) and multicast support (only for Radio/Dish sockets) to 
> both libzmq and czmq.

This sounds interesting

>   • Group (Radio/Dish topic) is string and currently limited to 15 chars 
> (might be increased in the future)

Can I put in a bid for at least 16? 16 is the minimum required for the binary 
encoding of a UUID (128 bits).

What's the reason for a compile time limit?

-- 
Alex Bligh




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


[zeromq-dev] [ANN] Providing a golang channel wrapper for pebbe/zmq4 golang zmq binding

2016-03-01 Thread Alex Bligh
I have developed an experimental wrapper for the excellent ZMQ4 golang binding 
at
  https://github.com/pebbe/zmq4

The wrapper allows for zmq.Socket to be wrapped so they can be accessed
through golang channels in a threadsafe and idiomatic manner. This allows
(inter-alia) golang select statements which mix ZMQ and non-ZMQ items,
for instance channels to represent cancellation.

You can find the code here:

  https://github.com/abligh/zmqchan

and documentation here:

  https://godoc.org/github.com/abligh/zmqchan

This could be an addition to the zmq4 golang binding, see:
  https://github.com/pebbe/zmq4/pull/81
but the current view of the maintainer is that this is not desirable,
(as per that pull request) therefore I am providing it as a separate library.

-- 
Alex Bligh




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


Re: [zeromq-dev] Loadtag entries on api.zeromq.org

2016-02-24 Thread Alex Bligh

On 24 Feb 2016, at 10:35, Pieter Hintjens <piet...@gmail.com> wrote:

> OK, fixed  now.

Thanks!

Alex

> On Wed, Feb 24, 2016 at 9:07 AM, Pieter Hintjens <piet...@gmail.com> wrote:
>> Something went wrong, thanks for reporting this. I'll fix it later today.
>> 
>> On 23 Feb 2016 21:54, "Alex Bligh" <a...@alex.org.uk> wrote:
>>> 
>>> api.zeromq.org appears to have been invaded by "LOAD TAG: entry"
>>> and "LOAD TAG: simpara".
>>> 
>>> See e.g.:
>>>  http://api.zeromq.org/4-0:zmq-socket
>>> 
>>> It would be more readable without these.
>>> 
>>> --
>>> Alex Bligh
>>> 
>>> 
>>> 
>>> 
>>> ___
>>> 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
> 
> 

-- 
Alex Bligh




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


[zeromq-dev] Loadtag entries on api.zeromq.org

2016-02-23 Thread Alex Bligh
api.zeromq.org appears to have been invaded by "LOAD TAG: entry"
and "LOAD TAG: simpara".

See e.g.:
  http://api.zeromq.org/4-0:zmq-socket

It would be more readable without these.

-- 
Alex Bligh




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


[zeromq-dev] ZeroMQ thread safety (or not)

2016-02-12 Thread Alex Bligh
I am attempting to write a Go Channel wrapper (similar to vaughan0's work but 
working on top of the pebbe's go bindings), as I'm using zmq in an environment 
where I will often want to use a golang 'select' mixing zmq sockets and other 
golang channels. I have a question about thread safety.

The ZeroMQ guide says: "Remember: Do not use or close sockets except in the 
thread that created them.". I want to know whether this is in fact a 
prohibition.

In Vaughan0's GoLang bindings, the MakePair function creates a pair of PAIR 
sockets in one thread:
  https://github.com/vaughan0/go-zmq/blob/master/util.go#L24

Each end of this pair is then passed to a different goroutine (thread-ish) here:
  https://github.com/vaughan0/go-zmq/blob/master/channels.go#L34

(i.e. ProcessOutgoing uses outsock, ProcessSockets uses insock)

This is a pretty useful thing to do. Is it permissible?

Specifically is the following pattern permissible?

 Thread 1Thread 2
 

 Create socket
 Connect() / Bind()
 Pass details to thread 2
 Never access socket again
 Use socket to read/write
 Close socket

This is essentially what the vaughan0 golang bindings are doing.

I understand completely that using the same socket in two threads at once is 
NOT permissible. However, unless the sockets are using thread local variables 
(which is going to be problematic in go as the same goroutine can be scheduled 
between different OS threads) I can't immediately see why the above would not 
work.

-- 
Alex Bligh




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


Re: [zeromq-dev] Multiplexing a TCP endpoint

2016-02-11 Thread Alex Bligh

On 10 Feb 2016, at 19:11, Tom Quarendon <tom.quaren...@teamwpc.co.uk> wrote:

> This is what "resources" in ZMTP 3.1 were designed for. No implementation yet 
> though (see other discussion on his list) :-)

Thanks. That is pretty much exactly what I was looking for (other than the 'no 
implementation yet though' bit).

I've only just subscribed to the list and my google search through the archives 
led only to a post in 2013 hoping this would be in zeromq 4.0. Do you have a 
pointer to the discussion (e.g. the thread title)?

I've read the relevant part of the ZTMP specification. In essence the 
'resource' seems to be transmitted in the metadata when the connection is set 
up. I'm guessing to use this feature in a compatible way without implementation 
details, then:

1. On the 'connect' side, I'd merely need to add some metadata

2. On the 'bind' side, I'd need to run some form of multiplexer and look at the 
metadata property.

I can't however see an API way to set or read from the metadata dictionary 
before any messages are passed.

Am I therefore correct that it isn't possible to implement this without a 
change to zeromq itself?

> You would have to write the proxy loop yourself. So do a select on the 
> external socket and all the internal sockets and know that when you pull a 
> message from the external socket that you peel off the first frame after the 
> delimiter, then use the service name it includes to pick which internal 
> socket to pass the rest of the message to. The services then run 
> independently on their own inproc (or even out of process on ipc or tcp) 
> sockets. It's what I would end up doing to do the same thing. 

That's pretty much what I concluded save for the fact that I had thought the 
service ID should probably be the innermost frame (possibly after the empty 
frame delimiter and with it's own zero frame delimiter) so the transport over 
TCP could (if necessary) be routed transparently through RTR sockets.

-- 
Alex Bligh




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


[zeromq-dev] Multiplexing a TCP endpoint

2016-02-10 Thread Alex Bligh
I am investigating building a zeromq-based application which runs over TCP. It 
will run many separate services over zeromq, mostly REP/REQ (via proxies), but 
also PUB/SUB.

The normal way to do this as far as I can tell is to use one TCP port per 
service. I want to avoid doing this, as the services can be dynamically created 
and deleted and I don't want to be bothered with different firewall rules, port 
management etc.

For inproc communication that's fine, as I can specify a unique name. However, 
the TCP endpoint does not have this. Only one socket can bind to a tcp port.

What I'd really like to do is simply to multiplex (by service name) multiple 
services (i.e. multiple sockets) onto the same TCP port. They would then pass 
like shadows in the night. I would like this to transparently work with 
encryption too.

I think this would be no harder than adding an additional frame (the service 
name) on send, and stripping it on receive. However, I can't immediately see 
how to do this using standard Router / Dealer code (partly because I'd have to 
somehow route the messages to the correct endpoints that had 'connected'), 
though I may be missing something. In many ways it would seem to be easier to 
modify the endpoint protocol.

Am I missing something? Am I approaching this the right way?

-- 
Alex Bligh




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


[zeromq-dev] adding other file descriptors to zmq::pollitem_t array

2015-03-03 Thread alex.
I am building a threaded file monitoring tool using zmq and inotify. I
discovered that I will have a nasty block when I want to end a thread
that is currently blocking while watching a file.

Since I am solving similar problems of threads waiting for zmq
messages with a double polling on two separate endpoints, one being
the actual endpoint and the other being a custom SIGTERM-message
broadcast from the main thread, I was wondering if I could do the same
here. As I want to solve all thread synchronisation problems using
such polling and zmq messages (stearing clear of stuff like mutexes
and signals), this seems to be a good go.

I dived into the code and realized that the zmq_poll() is basically a
wrapper for the system's poll() function, which is also the suggested
polling method for inotify. I went ahead and simply added inotify's
file descriptor (fd) as an item to my zmq::pollitem_t array (passing a
0 as the socket):

{ 0, fd, ZMQ_POLLIN, 0 }

This seems to work quite well actually! Now I wanted to ask if this is
okay for production use. I even let the ZMQ_POLLIN in, as I am not
sure if zeromq's polling will handle the system's POLLIN well enough,
but the inverse may just as well be true?

So is it advisable to just shove the fd of inotify into zmq's polling
function?

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


[zeromq-dev] czmq container serialization

2015-01-12 Thread Alex Cornejo
Hi all,

As part of an application I am developing I need to serialize/unserialize a
zlistx_t and a zhash_t into/from messages.

In my particular use case, the elements stored in these containers
belong to a custom czmq-style C class with its own
my_class_new/my_class_destroy.

When I first read the zhashx API I initially thought I could use
zhashx_pack/zhashx_unpack (at least for the zhashx), but I soon realized
this doesn't (and can't) work for custom types.

The solution I adopted required the following changes:

Implemented the following functions for the custom class:

// return the size of self in bytes
size_t my_class_size(my_class_t *self);

// serialize the contents of self into buf.
// the space used may not exceed my_class_size(self)
void my_class_store(my_class_t *self, void *buf);

// unserialize the contents of buf into a new my_class_t instance.
my_class_t *myclass_load(void *buf);

The behavior of myclass_store and myclass_load is such that the
following
is a valid implementation of myclass_dup:

my_class_t *myclass_dup(myclass_t *self) {
void *buf = zmalloc(my_class_size(self));
myclass_store(self, buf);
myclass_t *other = myclass_load(buf);
free(buf);
return other;
}

I also implemented the following methods for the container functions:

typedef size_t (size_func_t)(void *);
typedef void (store_func_t)(void *, void *);
typedef void *(load_func_t)(void *);

size_t zlistx_size(zlistx_t *self, size_func_t size_func);
void zlistx_store(zlistx_t *self, void *buf, size_func_t size_func,
store_func_t store_func);
zlistx_t *zlistx_load(void *buf, size_func_t size_func, load_func_t
load_func);

size_t zhashx_size(zhashx_t *self, size_func_t size_func);
void zhashx_store(zhashx_t *self, void *buf, size_func_t size_func,
store_func_t store_func);
zhashx_t *zhashx_load(void *buf, size_func_t size_func, load_func_t
load_func);

You will notice the load and store function signatures for zlistx and
zhashx are
different than for my_class, this is to accomodate for the fact that
these are containers and therefore must also be able to load and store
their elements.

Using the above methods its quite trivial to serialze and unserialize
lists and hashes into zframes for sending messages or into binary files
for long term storage. The same container serailization methods can be used
regardless of the type of elements they store, as long as they implement
the required load/store/size API for these elements.

Although the above works, I wanted to ask experienced czqm developers if
there is a more elegant way to implement container
serialization/unserialization in czmq.

Also, I would be surprised to find that I am the first czmq user that
needs to serialize custom containers into messages. Is there a reason
something like this is not already included in czmq's core? Should I
polish and document this and submit a pull-request, or does this seem
like a very uncommon use of containers in the czmq world?

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


[zeromq-dev] Inproc connection guide

2014-02-05 Thread Alex Pyrgiotis
Hi all,

Reading the zeromq guide, I'm seeing the following statement regarding
the inproc transport protocol:

the server must issue a bind before any client issues a connect

However, I'm reading the code and I see that there actually is support
for pending connections. From the looks of it, a client can issue a
connect and, if the server has not issued a bind yet, it adds itself
to a pending_connections structure which will be read once the server
binds the socket.

So, my question is, is the above statement outdated, or am I reading the
code incorrectly?

Thanks,
-- 
Alex | apyr...@grnet.gr
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Heartbeating using TCP keepalives

2014-01-03 Thread Alex Grönholm
03.01.2014 14:45, Bjorn Reese kirjoitti:
 On 01/03/2014 02:03 AM, Alex Grönholm wrote:

 As it stands, the TCP keepalive intervals are given in seconds on the
 vast majority of operating systems.
 Furthermore, if the peer is unresponsive then additional probes will be
 sent at regular intervals before the TCP keepalive mechanism reports a
 timeout. The details are also dependent on the operating system. For
 instance, on some BSD derived TCP stacks, 9 probes will be sent 75
 seconds apart, so a timeout will not be reported until 11 minutes and
 15 seconds have passed.
That is exactly why the parameters are configurable on a per-socket basis!

 ___
 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


Re: [zeromq-dev] Heartbeating using TCP keepalives

2014-01-03 Thread Alex Grönholm

03.01.2014 11:24, Laurent Alebarde kirjoitti:
The existing apps do not use yet 0MQ heartbeating anyhow, so there is 
no backward compatibility issue.
What 0MQ heartbeating? There is no 0MQ heartbeating implemented 
anywhere. I'm talking about TCP keepalives which is a whole different beast.
TCP keepalive parameters were exposed by libzmq 3 already, so there 
could very well be existing apps using it.


I support Matt point of view to keep libzmq homogeneous. I add that I 
don't like specifications or performances degradations when it can be 
avoided. There are standard usages that sustend your argumentation, 
and sometimes you think: why on the heal have they limited this?.


But there is always a middle path: it would be not costly to have an 
API with seconds and one with milliseconds for that case, in order to 
not break standard usage claimed by Alex.


Le 03/01/2014 02:03, Alex Grönholm a écrit :

02.01.2014 23:48, Pieter Hintjens kirjoitti:

Seconds is fine for this case but surprising overall since all other
durations in the API are in msec.

I'm not sure what you mean about backwards compatibility.

As it stands, the TCP keepalive intervals are given in seconds on the
vast majority of operating systems.
If we change it so the values are given in milliseconds instead (meaning
that we divide the given value by 1000 before calling setsockopt()),
this will break existing apps that set the keepalive intervals as seconds.

On Thu, Jan 2, 2014 at 7:55 PM, Alex Grönholmalex.gronh...@nextday.fi  wrote:

02.01.2014 15:59, Pieter Hintjens kirjoitti:

It makes sense, and I'd try this; the timeout should be in msec, to be
consistent with other duration arguments. You can take any of the
existing socket options like ZMQ_SNDBUF as a template, and make a pull
request.

Wouldn't it be enough to document that the values are expressed in
seconds and not ms?
Who needs sub-second accuracy with keepalives?
Besides, converting the values on non-Windows systems would break
backwards compatibility.
Are you fine with that? This definitely should not be done in a micro
release.

On Mon, Dec 30, 2013 at 11:29 PM, Alex Grönholm
alex.gronh...@nextday.fi  wrote:

This isn't directly related to ZeroMQ, but it is somewhat relevant now given
A) the addition of the (yet unimplemented) heartbeating feature in ZMTP/3.0
and B) the Windows TCP keepalive parameters fix I committed recently.
The question is: has someone here used TCP keepalives as a substitute for
application level heartbeating? Given the operating model of ZeroMQ, using
TCP keepalives for this purpose would transparently shield the user from
stale connections. Are there any downsides to this?
TCP keepalives, when turned on, use a 2 hour interval by default (this is a
de facto standard). This makes them impractical unless the values are
adjusted.
I've done some research on that. From what I've gathered, it seems that
setting TCP keepalive parameters on a per-socket level is supported at least
on the following operating systems:

Linux
FreeBSD
Windows (since Windows 2000; set only, read not supported; number of
keepalive probes is fixed on 10; must be set before connecting; values in
milliseconds, not seconds)
Mac OS X (since Mountain Lion)
AIX
Solaris (values in milliseconds, not seconds)

It seems that both iOS and Android support sending TCP keepalives, but
setting keepalive parameters is not supported.
Note that the Windows TCP keepalive parameters patch takes the time
intervals in seconds and multiplies by 1000 on Windows for cross platform
compatibility. There is no similar fix for Solaris yet so Solaris users need
to do it on the application level for now.

Setting the keepalive idle and retransmission delay to values like 10 and 5
seconds would make a lot of sense to me. If the peer fails to respond to the
probes, zmq will just see a disconnection.


___
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 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 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 mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Heartbeating using TCP keepalives

2014-01-02 Thread Alex Grönholm
02.01.2014 15:59, Pieter Hintjens kirjoitti:
 It makes sense, and I'd try this; the timeout should be in msec, to be
 consistent with other duration arguments. You can take any of the
 existing socket options like ZMQ_SNDBUF as a template, and make a pull
 request.
Wouldn't it be enough to document that the values are expressed in 
seconds and not ms?
Who needs sub-second accuracy with keepalives?
Besides, converting the values on non-Windows systems would break 
backwards compatibility.
Are you fine with that? This definitely should not be done in a micro 
release.

 On Mon, Dec 30, 2013 at 11:29 PM, Alex Grönholm
 alex.gronh...@nextday.fi wrote:
 This isn't directly related to ZeroMQ, but it is somewhat relevant now given
 A) the addition of the (yet unimplemented) heartbeating feature in ZMTP/3.0
 and B) the Windows TCP keepalive parameters fix I committed recently.
 The question is: has someone here used TCP keepalives as a substitute for
 application level heartbeating? Given the operating model of ZeroMQ, using
 TCP keepalives for this purpose would transparently shield the user from
 stale connections. Are there any downsides to this?
 TCP keepalives, when turned on, use a 2 hour interval by default (this is a
 de facto standard). This makes them impractical unless the values are
 adjusted.
 I've done some research on that. From what I've gathered, it seems that
 setting TCP keepalive parameters on a per-socket level is supported at least
 on the following operating systems:

 Linux
 FreeBSD
 Windows (since Windows 2000; set only, read not supported; number of
 keepalive probes is fixed on 10; must be set before connecting; values in
 milliseconds, not seconds)
 Mac OS X (since Mountain Lion)
 AIX
 Solaris (values in milliseconds, not seconds)

 It seems that both iOS and Android support sending TCP keepalives, but
 setting keepalive parameters is not supported.
 Note that the Windows TCP keepalive parameters patch takes the time
 intervals in seconds and multiplies by 1000 on Windows for cross platform
 compatibility. There is no similar fix for Solaris yet so Solaris users need
 to do it on the application level for now.

 Setting the keepalive idle and retransmission delay to values like 10 and 5
 seconds would make a lot of sense to me. If the peer fails to respond to the
 probes, zmq will just see a disconnection.


 ___
 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 mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Heartbeating using TCP keepalives

2014-01-02 Thread Alex Grönholm
02.01.2014 23:48, Pieter Hintjens kirjoitti:
 Seconds is fine for this case but surprising overall since all other
 durations in the API are in msec.

 I'm not sure what you mean about backwards compatibility.
As it stands, the TCP keepalive intervals are given in seconds on the 
vast majority of operating systems.
If we change it so the values are given in milliseconds instead (meaning 
that we divide the given value by 1000 before calling setsockopt()), 
this will break existing apps that set the keepalive intervals as seconds.

 On Thu, Jan 2, 2014 at 7:55 PM, Alex Grönholm alex.gronh...@nextday.fi 
 wrote:
 02.01.2014 15:59, Pieter Hintjens kirjoitti:
 It makes sense, and I'd try this; the timeout should be in msec, to be
 consistent with other duration arguments. You can take any of the
 existing socket options like ZMQ_SNDBUF as a template, and make a pull
 request.
 Wouldn't it be enough to document that the values are expressed in
 seconds and not ms?
 Who needs sub-second accuracy with keepalives?
 Besides, converting the values on non-Windows systems would break
 backwards compatibility.
 Are you fine with that? This definitely should not be done in a micro
 release.
 On Mon, Dec 30, 2013 at 11:29 PM, Alex Grönholm
 alex.gronh...@nextday.fi wrote:
 This isn't directly related to ZeroMQ, but it is somewhat relevant now 
 given
 A) the addition of the (yet unimplemented) heartbeating feature in ZMTP/3.0
 and B) the Windows TCP keepalive parameters fix I committed recently.
 The question is: has someone here used TCP keepalives as a substitute for
 application level heartbeating? Given the operating model of ZeroMQ, using
 TCP keepalives for this purpose would transparently shield the user from
 stale connections. Are there any downsides to this?
 TCP keepalives, when turned on, use a 2 hour interval by default (this is a
 de facto standard). This makes them impractical unless the values are
 adjusted.
 I've done some research on that. From what I've gathered, it seems that
 setting TCP keepalive parameters on a per-socket level is supported at 
 least
 on the following operating systems:

 Linux
 FreeBSD
 Windows (since Windows 2000; set only, read not supported; number of
 keepalive probes is fixed on 10; must be set before connecting; values in
 milliseconds, not seconds)
 Mac OS X (since Mountain Lion)
 AIX
 Solaris (values in milliseconds, not seconds)

 It seems that both iOS and Android support sending TCP keepalives, but
 setting keepalive parameters is not supported.
 Note that the Windows TCP keepalive parameters patch takes the time
 intervals in seconds and multiplies by 1000 on Windows for cross platform
 compatibility. There is no similar fix for Solaris yet so Solaris users 
 need
 to do it on the application level for now.

 Setting the keepalive idle and retransmission delay to values like 10 and 5
 seconds would make a lot of sense to me. If the peer fails to respond to 
 the
 probes, zmq will just see a disconnection.


 ___
 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 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 mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] Heartbeating using TCP keepalives

2013-12-30 Thread Alex Grönholm
This isn't directly related to ZeroMQ, but it is somewhat relevant now 
given A) the addition of the (yet unimplemented) heartbeating feature in 
ZMTP/3.0 and B) the Windows TCP keepalive parameters fix I committed 
recently.
The question is: has someone here used TCP keepalives as a substitute 
for application level heartbeating? Given the operating model of ZeroMQ, 
using TCP keepalives for this purpose would transparently shield the 
user from stale connections. Are there any downsides to this?
TCP keepalives, when turned on, use a 2 hour interval by default (this 
is a de facto standard). This makes them impractical unless the values 
are adjusted.
I've done some research on that. From what I've gathered, it seems that 
setting TCP keepalive parameters on a per-socket level is supported at 
least on the following operating systems:


 * Linux
 * FreeBSD
 * Windows (since Windows 2000; set only, read not supported; number of
   keepalive probes is fixed on 10; must be set before connecting;
   values in milliseconds, not seconds)
 * Mac OS X (since Mountain Lion)
 * AIX
 * Solaris (values in milliseconds, not seconds)

It seems that both iOS and Android support sending TCP keepalives, but 
setting keepalive parameters is not supported.
Note that the Windows TCP keepalive parameters patch takes the time 
intervals in seconds and multiplies by 1000 on Windows for cross 
platform compatibility. There is no similar fix for Solaris yet so 
Solaris users need to do it on the application level for now.


Setting the keepalive idle and retransmission delay to values like 10 
and 5 seconds would make a lot of sense to me. If the peer fails to 
respond to the probes, zmq will just see a disconnection.


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


[zeromq-dev] jzmq recvZeroCopy not returning anything to me and cause error while exit

2013-09-17 Thread Alex Suo
Hi there,

Thank you for your time in advance. I am doing my high performance system
based on ZeroMQ and jzmq in Java. While I am trying to use direct buffer, I
encountered some problem. I have summarize it into the following test code
in windows.

My unit test environment is:

Windows 7 64bit
ZeroMQ 3.2.3
jzmq master from GIT, checked out in July 2013
JDK 1.7.0_25

And the ftest code is as following. You can see in the subscriber thread
that if I use the recv(ZMQ.DONTWAIT) way it works perfectly; but if I use
the direct buffer, it gives me no response while running and gives me the
following error on exit:

Exception in thread Thread-0 org.zeromq.ZMQException: Resource
temporarily unavailable(0xb)
at org.zeromq.ZMQ$Socket.recvZeroCopy(Native Method)
at
org.as.algo.messaging.bus.zmq.ZMQReadynessTest$1.run(ZMQReadynessTest.java:48)


If I try to use in-direct ByteBuffer, I don't have exception on exit but
still cannot receive anything.

Please kindly assist me. Lots of thanks.

Alex

import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import java.nio.ByteBuffer;
import java.util.concurrent.atomic.AtomicInteger;

import org.junit.Before;
import org.junit.Test;
import org.zeromq.ZMQ;

/**
 * Test if ZMQ is ready on this box.
 *
 * @author Alex Suo
 *
 */
public class ZMQReadynessTest {

private ZMQ.Context context;

@Before
public void setUp() {
context = ZMQ.context(1);
}

@Test
public void testSimpleMessage() {
String topic = tcp://127.0.0.1:31216;
final AtomicInteger counter = new AtomicInteger();


// create a simple subscriber
final ZMQ.Socket subscribeSocket = context.socket(ZMQ.SUB);
subscribeSocket.connect(topic);
subscribeSocket.subscribe(TestTopic.getBytes());

Thread subThread = new Thread() {

@Override
public void run() {
while (true) {
String value = null;

// This would result in trouble
{
ByteBuffer buffer = ByteBuffer.allocateDirect(100);
if (subscribeSocket.recvZeroCopy(buffer,
buffer.remaining(), ZMQ.DONTWAIT)  0) {

buffer.flip();

value = buffer.asCharBuffer().toString();

System.out.println(buffer.asCharBuffer().toString());
}
}

// This works perfectly
/*
{
byte[] bytes = subscribeSocket.recv(ZMQ.DONTWAIT);
if (bytes == null || bytes.length == 0) {
continue;
}

value = new String(bytes);
}
 */

if (value != null  value.length()  0) {
counter.incrementAndGet();
System.out.println(value);
break;
}
}
}
};
subThread.start();

// create a simple publisher - wait 3 sec to make sure its ready
ZMQ.Socket publishSocket = context.socket(ZMQ.PUB);
publishSocket.bind(tcp://*:31216);

try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
fail();
}

// publish a sample message
try {
publishSocket.send(TestTopic.getBytes(), ZMQ.SNDMORE);
publishSocket.send(This is test string.getBytes(), 0);
subThread.join(100);
} catch (InterruptedException e) {
e.printStackTrace();
fail();
}

assertTrue(counter.get()  0);
System.out.println(counter.get());
}

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


Re: [zeromq-dev] Help with pattern design

2012-08-02 Thread Alex Massover
Hello,

Thank you very much Michel! Router-to-Dealer is exactly what I need.
I should be reading the guide more carefully.


On 2 באוג 2012, at 19:17, Michel Pelletier pelletier.mic...@gmail.com wrote:

 You want to read up on the ROUTER socket.  It's the goto when you need
 a custom routing setup other than the built in load balanced
 functionality in PUSH and DEALER.  In your server, you would maintain
 a mapping of session ids to worker ids.  The LRU pattern in the guide
 defines a nice example for this kind of setup.
 
 -Michel
 
 On Thu, Aug 2, 2012 at 8:34 AM, Alex Massover a...@jajah.com wrote:
 Hello,
 
 
 
 I'm trying to design a pattern that will fit my application but can't find a
 proper solution. I'd appreciate if someone could enlighten me.
 
 
 
 I have a process that deals with sessions (voip calls). This server produce
 events for every session, e.g.:
 
 Session1: start
 
 Session1: msgA
 
 Session1: msgB
 
 Session1: msgC
 
 …
 
 Session1: msgX
 
 Session1: stop
 
 
 
 Each event has a session id. Many sessions exist concurrently.
 
 
 
 And there're multiple workers that consume these events. Single event should
 go to single worker. (PUSH/PULL like pattern).
 
 
 
 My initial though was single PUSH (server that produce events) and multiple
 PULL (workers that consume).
 
 
 
 My challenge is avoid race condition in processing events, i.e. workers
 supposed to consume events in the same order as they produced. And this
 should be done in realtime, I can't serialize at worker side. And single
 worker is not enough from performance point of view.
 
 
 
 Is there any ZMQ magic (pattern) that can force all events from single
 session (based on session id?) to be sent to same worker? This way I'll
 ensure that worker process events in the same order they appeared.
 
 
 
 --
 
 Best Regards,
 
 Alex Massover
 
 
 
 
 ___
 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 mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] syncpub/syncsub example losing messages (ZMQ 3.2.0-rc1, Solaris 11)

2012-07-18 Thread Alex Keahan
Alex Keahan akeahan at gbtradingllc.com writes:

 $ ./syncpub 
 [1] 6611
 $ Waiting for subscribers
 
 $ ./syncsub A 
 [2] 6612
 $ ./syncsub B 
 [3] 6613
 $ Broadcasting messages
 Message mismatch: received 'Msg #1266' expected 'Msg #1001'
 A: received 1000 updates
 Message mismatch: received 'Msg #1266' expected 'Msg #1001'
 B: received 1000 updates
 


Whoops.   The high water mark for outbound messages was changed from 0 (no
limit) in 2.2 to 1000 in 3.2.

Not a bug, please disregard.


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


[zeromq-dev] syncpub/syncsub example losing messages (ZMQ 3.2.0-rc1, Solaris 11)

2012-07-17 Thread Alex Keahan
ZMQ 3.2.0-rc1 was built with the latest Sun Studio C/C++ compilers,
with CFLAGS and CXXFLAGS=-fast -library=stlport4.

$ uname -a
SunOS xx 5.11 11.0 i86pc i386 i86pc
$ CC -V
CC: Sun C++ 5.12 SunOS_i386 2011/11/16
$ cc -V
cc: Sun C 5.12 SunOS_i386 2011/11/16


The syncpub/syncsub example from the guide was adapted to 3.2.0 (see
the code below).

The original version of syncsub would simply get stuck in zmq_recv().
 I added extra code to detect sequence gaps and break out of the loop
whenever there's a discrepancy; now all syncsubs print received N
updates where N is somewhat random.   Slowing down the producer fixes
the problem.   Zmq reports no errors at any point.

As a side note, whenever there is a sequence gap, the next sequence
number received by syncsub appears to come from the start of the next
send() buffer sent by syncpub (confirmed by 'truss syncpub')

Any suggestions?

Alex Keahan


Run as follows:

$ ./syncpub 
$ ./syncsub A 
$ ./syncsub B 

You should see something similar to this:

$ ./syncpub 
[1] 6611
$ Waiting for subscribers

$ ./syncsub A 
[2] 6612
$ ./syncsub B 
[3] 6613
$ Broadcasting messages
Message mismatch: received 'Msg #1266' expected 'Msg #1001'
A: received 1000 updates
Message mismatch: received 'Msg #1266' expected 'Msg #1001'
B: received 1000 updates

[2]-  Done./syncsub A
[3]+  Done./syncsub B


syncpub.c:

#include stdio.h
#include strings.h
#include unistd.h
#include zmq.h

// Wait for 2 subscribers
#define SUBSCRIBERS_EXPECTED 2

int
main(int argc, char *argv[])
{
  void *context = zmq_ctx_new();
  if (context == 0) {
fprintf(stderr, Error: zmq_ctx_new failed: %s\n, zmq_strerror(errno));
return 1;
  }
  int rc = zmq_ctx_set(context, ZMQ_IO_THREADS, 1);
  if (rc != 0) {
fprintf(stderr, Error: zmq_ctx_set failed: %s\n, zmq_strerror(errno));
return 2;
  }

  // Socket to talk to clients
  void *publisher = zmq_socket(context, ZMQ_PUB);
  if (publisher == 0) {
fprintf(stderr, Error: zmq_socket(ZMQ_PUB) failed: %s\n,
zmq_strerror(errno));
return 4;
  }

  rc = zmq_bind (publisher, tcp://*:5561);
  if (rc != 0) {
fprintf(stderr, Error: zmq_bind failed: %s\n, zmq_strerror(errno));
return 5;
  }

  // Socket to receive signals
  void *syncservice = zmq_socket (context, ZMQ_REP);
  if (syncservice == 0) {
fprintf(stderr, Error: zmq_socket(ZMQ_REP) failed: %s\n,
zmq_strerror(errno));
return 6;
  }

  rc = zmq_bind (syncservice, tcp://*:5562);
  if (rc != 0) {
fprintf(stderr, Error: zmq_bind failed: %s\n, zmq_strerror(errno));
return 7;
  }

  // Get synchronization from subscribers
  printf (Waiting for subscribers\n);
  int subscribers = 0;
  while (subscribers  SUBSCRIBERS_EXPECTED) {
char tmp[24];

// - wait for synchronization request
int size = zmq_recv(syncservice, tmp, sizeof(tmp), 0);
if (size  0) {
  fprintf(stderr, Error: zmq_recv failed: %s\n, zmq_strerror(errno));
  return 8;
}

// - send synchronization reply
rc = zmq_send(syncservice, , 0, 0);
if (rc  0) {
  fprintf(stderr, Error: zmq_send failed: %s\n, zmq_strerror(errno));
  return 9;
}

subscribers++;
  }
  // Now broadcast exactly 100,000 updates followed by END
  printf (Broadcasting messages\n);
  int update_nbr;
  for (update_nbr = 0; update_nbr  10; update_nbr++) {
char buf[24];
int len;
sprintf(buf, Msg #%d, update_nbr+1);
len = strlen(buf);

int size = zmq_send(publisher, buf, len, 0);
if (size != len) {
  if (errno == EAGAIN) {
update_nbr--;
continue;
  }
  fprintf(stderr, Error: zmq_send failed: %s\n, zmq_strerror(errno));
  return 10;
}
  }

  int size = zmq_send(publisher, END, 3, 0);
  if (size != 3) {
fprintf(stderr, Error: zmq_send failed: %s\n, zmq_strerror(errno));
return 11;
  }

  sleep(10);

  zmq_close(publisher);
  zmq_close(syncservice);
  zmq_term (context);

  return 0;
}


syncsub.c:


#include stdio.h
#include strings.h
#include unistd.h
#include zmq.h

int
main(int argc, char *argv[])
{
  const char *prefix = (argc  1 ? argv[1] : );

  void *context = zmq_ctx_new();
  if (context == 0) {
fprintf(stderr, Error: zmq_ctx_new failed: %s\n, zmq_strerror(errno));
return 1;
  }
  int rc = zmq_ctx_set(context, ZMQ_IO_THREADS, 1);
  if (rc != 0) {
fprintf(stderr, Error: zmq_ctx_set failed: %s\n, zmq_strerror(errno));
return 2;
  }

  // First, connect our subscriber socket
  void *subscriber = zmq_socket(context, ZMQ_SUB);
  if (subscriber == 0) {
fprintf(stderr, Error: zmq_socket(ZMQ_SUB) failed: %s\n,
zmq_strerror(errno));
return 4;
  }

  rc = zmq_connect(subscriber, tcp://localhost:5561);
  if (rc != 0) {
fprintf(stderr, Error: zmq_connect failed: %s\n, zmq_strerror(errno));
return 5;
  }

  rc = zmq_setsockopt (subscriber, ZMQ_SUBSCRIBE, , 0);
  if (rc != 0) {
fprintf(stderr, Error: zmq_setsockopt failed: %s\n, zmq_strerror(errno

Re: [zeromq-dev] ZeroMQ Hello World Perl Example Start Up

2012-07-16 Thread Alex Sergeyev
This would be appropriate to commit:


--- a/examples/Perl/rrserver.pl
+++ b/examples/Perl/rrserver.pl
@@ -21,7 +21,7 @@ my $context = ZeroMQ::Context-new();

 # Socket to talk to clients
 my $responder = $context-socket(ZMQ_REP);
-$responder-connect('tcp://localhost:5560');
+$responder-bind('tcp://*:5559');

 while (1) {
 # Wait for next request from client


(localhost is ambiguous IPv6 vs IPv4, so I used * for simplicity)
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] ZMQ 2-x PUBSUB when router dies

2012-06-01 Thread Alex Sergeyev
Hi,

I have interesting observation which is probably could not be
addressed in ZMQ, just to confirm I'm not crazy and things should be
this way.

One router core-dumped today. Subscriber behind it never realized that
it's time to reconnect and kept waiting for messages until I realized
that data is not there... Do you know what is the scenario of events
for such situation? How long would've that continued until anything
(OS or ZMQ) would've closed that socket?

Should I have application - level fix for such situation or there is
some ZMQ socket option that I could've used?

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


Re: [zeromq-dev] ZMQ 2-x PUBSUB when router dies

2012-06-01 Thread Alex Sergeyev
Yeah, I'll probably go this way. The thing is that publisher did not
die, it's the router in-between them that gone away suddenly (crashed
in a way similar to unplugging it or separating network physically
without letting the endpoints know about it).

IMO tcp keepalive that you have in 3.1 could be helpful to deal with
situation like this in future.


Thanks!


Alex.


On Fri, Jun 1, 2012 at 5:20 PM, Pieter Hintjens p...@imatix.com wrote:
 On Fri, Jun 1, 2012 at 9:37 PM, Alex Sergeyev a...@alexsergeyev.com wrote:

 One router core-dumped today. Subscriber behind it never realized that
 it's time to reconnect and kept waiting for messages until I realized
 that data is not there... Do you know what is the scenario of events
 for such situation? How long would've that continued until anything
 (OS or ZMQ) would've closed that socket?

 Should I have application - level fix for such situation or there is
 some ZMQ socket option that I could've used?

 Normally if the publisher restarts, the subscriber socket will
 reconnect automatically. There is no 0MQ option for the subscriber to
 give up. You can add this quite easily... send a heartbeat if there is
 no other data going out, then if there's no heartbeat after a timeout,
 the subscriber knows the publisher is dead or frozen.

 -Pieter
 ___
 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


Re: [zeromq-dev] polling for messages

2012-03-27 Thread Alex Zeffertt
Thanks for the info.

-- Alex

On 26 March 2012 20:11, Lourens Naudé lour...@methodmissing.com wrote:
 Hi Alex,

 That'll be fine - the fd events are edge-triggered and would work with any
 reactor implementation. Just remember to read until completion as the
 notification can be for more than one message (zmq protocol is framed) as
 well. Failure to do so will result in further notifications not being
 triggered.

 - Lourens


 On Monday, March 26, 2012, Pieter Hintjens piet...@gmail.com wrote:
 Yes, it should work fine.

 On Mar 26, 2012 11:44 AM, Alex Zeffertt azeffe...@cambridgesys.com
 wrote:

 Hi list,

 I'm considering using czmq in my single threaded application.
 However, the application is already using an event driven framework in
 which a file descriptor has to be registered along with a callback
 that is invoked when it becomes readable.

 My question is: can I use the file descriptor returned by
 zsockopt_fd() in this way, or would this break things  when I issue
 zframe_recv_nowait()?

 Thanks in advance,

 Alex
 ___
 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 mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] polling for messages

2012-03-26 Thread Alex Zeffertt
Hi list,

I'm considering using czmq in my single threaded application.
However, the application is already using an event driven framework in
which a file descriptor has to be registered along with a callback
that is invoked when it becomes readable.

My question is: can I use the file descriptor returned by
zsockopt_fd() in this way, or would this break things  when I issue
zframe_recv_nowait()?

Thanks in advance,

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


[zeromq-dev] Cross -Compiling with gcc-3.3.1

2011-08-29 Thread Alex Ramirez
Hi,

Have been attempting to cross compile libzmq.a for a PowerPC-405
processor which uses the following tool set versions:

gcc 3.3.1
glibc 2.3.2

As expected, have received multiple linking errors relating to
features not available with libstdc++.so.5 (gcc 3.3.1). The
PopwerPC-405 is prepackaged with a custom linux installation that is
provided by a third party vendor. I've contacted them about support
for upgrading to newer versions of gcc and glibc, tough it's likely
this will not be an option.

Has any had any experience/success cross compiling zeromq libraries
with these older toolsets?

Any support is greatly appreciated!

Thanks,

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


Re: [zeromq-dev] Cross -Compiling with gcc-3.3.1

2011-08-29 Thread Alex Ramirez
Hi Mikko,

Am able to get the zeromq src to compile and link such that the libzmq.a and
libzmq.la files are created in the hidden .lib directory.

Start seeing link failures when I try to link to to the existing libzmq.la /
libzmq.a files. I've attached the console output from the failures I'm
seeing when I try to compile and link the performance package.

The link errors of interest I'm seeing in this example are:

undefined reference to `std::char_traitsunsigned char::copy(unsigned
char*, unsigned char const*, unsigned)'
undefined reference to `epoll_create'
undefined reference to `epoll_ctl'
undefined reference to `epoll_wait'

All these calls appear to link to libstdc++.so.6, and gcc-3.3.1 is only
compatible with libstdc++.so.5.

Any support is greatly appreciated!

Thanks,

Alex



On Mon, Aug 29, 2011 at 3:53 PM, Mikko Koppanen mikko.koppa...@gmail.comwrote:

 On Mon, Aug 29, 2011 at 9:02 PM, Alex Ramirez alex.r.rami...@gmail.com
 wrote:
  Hi,
 
  Have been attempting to cross compile libzmq.a for a PowerPC-405
  processor which uses the following tool set versions:
 
  gcc 3.3.1
  glibc 2.3.2
 
  As expected, have received multiple linking errors relating to
  features not available with libstdc++.so.5 (gcc 3.3.1). The
  PopwerPC-405 is prepackaged with a custom linux installation that is
  provided by a third party vendor. I've contacted them about support
  for upgrading to newer versions of gcc and glibc, tough it's likely
  this will not be an option.
 
  Has any had any experience/success cross compiling zeromq libraries
  with these older toolsets?
 

 Hi Alex,

 which features specifically are not available?

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




-- 
“Yesterday is history. Tomorrow is a mystery. Today is a gift. That's why it
is called the present.”
/home/omni/omni-linux-src/build-tools/gdb/build_gdb/bfd/libtool  --tag=CXX   
--mode=link /home/omni/omni-linux-sdk/tools/bin/powerpc-405-linux-gnu-g++  
-L/home/omni/omni-linux-sdk/tools/powerpc-405-linux-gnu/lib 
-I/home/omni/Desktop/zeromqppc/luuid/include 
-I/home/omni/omni-linux-sdk/tools/include 
-I/home/omni/omni-linux-sdk/tools/powerpc-405-linux-gnu/sys-include  
-L/home/omni/Desktop/zeromqppc/luuid/lib -o local_lat local_lat.o 
../src/libzmq.la -luuid -lrt -lpthread -lstdc++
libtool: ignoring unknown tag CXX
libtool: link: warning: library 
`/home/omni/omni-linux-sdk/tools/powerpc-405-linux-gnu/lib/libstdc++.la' was 
moved.
libtool: link: warning: library 
`/home/omni/omni-linux-sdk/tools/powerpc-405-linux-gnu/lib/libstdc++.la' was 
moved.
/home/omni/omni-linux-sdk/tools/bin/powerpc-405-linux-gnu-g++ 
-I/home/omni/Desktop/zeromqppc/luuid/include 
-I/home/omni/omni-linux-sdk/tools/include 
-I/home/omni/omni-linux-sdk/tools/powerpc-405-linux-gnu/sys-include -o 
local_lat local_lat.o  
-L/home/omni/omni-linux-sdk/tools/powerpc-405-linux-gnu/lib 
-L/home/omni/Desktop/zeromqppc/luuid/lib ../src/.libs/libzmq.a 
-L/home/omni/omni-linux-src/build-tools/crosstool-0.25/build/powerpc-405-linux-gnu/gcc-3.3.1-glibc-2.3.2/build-gcc/powerpc-405-linux-gnu/libstdc++-v3/src
 
-L/home/omni/omni-linux-src/build-tools/crosstool-0.25/build/powerpc-405-linux-gnu/gcc-3.3.1-glibc-2.3.2/build-gcc/powerpc-405-linux-gnu/libstdc++-v3/src/.libs
 -lm -lm -lm 
-L/home/omni/omni-linux-src/build-tools/crosstool-0.25/build/powerpc-405-linux-gnu/gcc-3.3.1-glibc-2.3.2/build-gcc/gcc
 
-L/home/omni/omni-linux-src/build-tools/crosstool-0.25/result/powerpc-405-linux-gnu/gcc-3.3.1-glibc-2.3.2/powerpc-405-linux-gnu/bin
 
-L/home/omni/omni-linux-src/build-tools/crosstool-0.25/result/powerpc-405-linux-gnu/gcc-3.3.1-glibc-2.3.2/powerpc-405-linux-gnu/lib
 
-L/home/omni/omni-linux-src/build-tools/crosstool-0.25/result/powerpc-405-linux-gnu/gcc-3.3.1-glibc-2.3.2/lib/gcc-lib/powerpc-405-linux-gnu/3.3.1
 
-L/home/omni/omni-linux-src/build-tools/crosstool-0.25/result/powerpc-405-linux-gnu/gcc-3.3.1-glibc-2.3.2/lib/gcc-lib/powerpc-405-linux-gnu/3.3.1/../../../../powerpc-405-linux-gnu/lib
 -lgcc_s -lc -lgcc_s -lm -lgcc_s -lc -lgcc_s -luuid -lrt -lpthread 
/home/omni/omni-linux-sdk/tools/powerpc-405-linux-gnu/lib/libstdc++.so -lm -lm 
-lm -lgcc_s -lc -lgcc_s -lm -lgcc_s -lc -lgcc_s -Wl,--rpath 
-Wl,/home/omni/omni-linux-sdk/tools/powerpc-405-linux-gnu/lib -Wl,--rpath 
-Wl,/home/omni/omni-linux-sdk/tools/powerpc-405-linux-gnu/lib
../src/.libs/libzmq.a(libzmq_la-ctx.o)(.gnu.linkonce.t._ZNSbIhSt11char_traitsIhESaIhEE4_Rep8_M_cloneERKS1_j+0xfc):
 In function `std::basic_stringunsigned char, std::char_traitsunsigned char, 
std::allocatorunsigned char ::_Rep::_M_clone(std::allocatorunsigned char 
const, unsigned)':
: undefined reference to `std::char_traitsunsigned char::copy(unsigned char*, 
unsigned char const*, unsigned)'
../src/.libs/libzmq.a(libzmq_la-object.o)(.gnu.linkonce.t._ZNSbIhSt11char_traitsIhESaIhEE13_S_copy_charsEPhPKhS5_+0x38):
 In function

Re: [zeromq-dev] Cross -Compiling with gcc-3.3.1

2011-08-29 Thread Alex Ramirez
Hi Mikko,

Your suggestions worked perfectly! Can't thank you enough :)

All the best,

Alex

On Mon, Aug 29, 2011 at 5:07 PM, Mikko Koppanen mikko.koppa...@gmail.comwrote:

 On Tue, Aug 30, 2011 at 12:48 AM, Alex Ramirez alex.r.rami...@gmail.com
 wrote:
  The link errors of interest I'm seeing in this example are:
  undefined reference to `std::char_traitsunsigned char::copy(unsigned
  char*, unsigned char const*, unsigned)'
  undefined reference to `epoll_create'
  undefined reference to `epoll_ctl'
  undefined reference to `epoll_wait'
  All these calls appear to link to libstdc++.so.6, and gcc-3.3.1 is only
  compatible with libstdc++.so.5.
  Any support is greatly appreciated!

 Hi,

 the epoll errors are caused because there is no epoll available on the
 target platform. If you add -DZMQ_FORCE_POLL to CPPFLAGS it should
 take care of those. I think the second error (I assume) is because too
 old toolchain and ZeroMQ blob.hpp, which has the following:

 typedef std::basic_string unsigned char blob_t;

 You might be able to fix this by similar fashion to:

 http://www.google.com/codesearch#NpsCNDAcr4w/MorphKad/id3lib/include/id3/id3lib_strings.h
 (haven't got this old toolchain to test so just guessing here).

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




-- 
“Yesterday is history. Tomorrow is a mystery. Today is a gift. That's why it
is called the present.”
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] Newbie questions

2011-04-01 Thread Alex du Plessis

Hello list,

I'm a complete newbie in the use and application of Zeromq so I am sure 
my questions will sound quite inane and downright stupid.  I apologise 
in advance.  I stumbled on ZeroMQ early this week while googling for a 
decent message system that is'nt implemented in Java. I use 
FPC(FreePascal) and Lazarus (both Open Source products) as my 
programming platform  and intend to write a binding as well as 
component/s to enable the use of ZeroMQ with FPC.  Unfortunately, I am 
not very C proficient, so I am also doing a crash course in C/C++ at the 
moment.  I have already started the port and I'm ironing out the 
wrinkles in my interface unit .So much for the intro, here's my 
question:


From the api documentation on the web it seems that the variable ffn of 
type zmq_free_fn as defined in the parameters of *zmq_msg_init_data* is 
a user supplied function and one needs to pass a pointer to a function 
that will free the message data.  Is this correct?


Regards


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


Re: [zeromq-dev] [PATCH] Update to OpenPGM 5.1.110.

2011-03-07 Thread Alex Forster
Ah, is that the trunk version you were saying you got to build successfully on 
x64?



On Mar 6, 2011, at 11:08 PM, Steven McCoy steven.mc...@miru.hk wrote:

 On 7 March 2011 01:31, Alex Forster a...@alexforster.com wrote:
 Steven McCoy steven.mccoy at miru.hk writes:
 
  Clean builds under Win64.
  ...
  Improve spinlock performance with inline ticket based spinlock 
  implementation.
 
 http://www.google.com/search?q=__asm+keyword+not+supported+on+this+architecture
 
 ticket.h is coughing up because Visual C++ doesn't support inline assembly 
 when
 targeting 64-bit.
 
 
 Oh that's nice.
  
 http://code.google.com/p/openpgm/source/diff?
 spec=svn1294r=1294format=sidepath=/trunk/openpgm/pgm/include/impl/ticket.h
 
 This diff points out where the problem areas are-
 
 pgm_atomic_add8
 pgm_atomic_fetch_and_add8
 pgm_atomic_inc8
 
 pgm_atomic_add16
 pgm_atomic_fetch_and_add16
 pgm_atomic_inc16
 
 
 It was a clean build before ticket locks :-)
 
 I've added some MASM64 to trunk to implement the assembler as functions but 
 I'm without 64-bit MSVC to test, I wouldn't say Im overly confident on the 
 64-bit assembler either.
 
 -- 
 Steve-o
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] [PATCH] Update to OpenPGM 5.1.110.

2011-03-07 Thread Alex Forster
 The trunk builds but skips the asm because CMake 2.8.3 is broken, I've 
 updated to 2.8.4 and CMake is too stupid to find MSVC 2010 Professional and 
 asks me to install the 7.1 SDK so I end up with I guess six compilers now.

Aha.

 The 8-bit and 16-bit atomics are a part of how ticket locks work, they 
 improve latency in low contention situations, i.e. PGM bus scenarios.

?? didn't know what a ticket lock was until yesterday, so I'll take your word 
for it.

 Out of interest in playing with new integration features I'll see how long I 
 can put up with the MASM before dumping it.

How well do the asm files fit into the build system? Is it an issue?

I spent more time than I'd like to admit yesterday googling, since I was only 
~30 lines away from a successful build. Essentially the solution you came up 
with is the only solution there is if you want to maintain MSVC compatibility: 
use an external assembler. I haven't tried to compile trunk yet, but I'm sure 
it will be fine. It looks from the commit message that you did exactly what I 
did - check out how TBB does it. 
http://people.athenacr.com/~wchow/repos/tbb/tbb-2.0r014/src/tbb/ia32-masm/atomic_support.asm
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] [PATCH] Update to OpenPGM 5.1.110.

2011-03-07 Thread Alex Forster
 Just minor tweaks, already noted on stackoverflow that ML64 does not have the 
 same features as ML, the examples in the SDK have an invalid syntax when 
 ported to x64.
 
 Also, CMake doesn't generate the MSVC project files including the asm, 
 probably at a later date as it is plastered with notices.

Not a huge deal to make the libs beforehand, it will still get me 95% of the 
way there. I'll give it a try sometime this week, thanks!
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] [PATCH] Update to OpenPGM 5.1.110.

2011-03-06 Thread Alex Forster
Steven McCoy steven.mccoy at miru.hk writes:

 Clean builds under Win64.
 ...
 Improve spinlock performance with inline ticket based spinlock implementation.

http://www.google.com/search?q=__asm+keyword+not+supported+on+this+architecture

ticket.h is coughing up because Visual C++ doesn't support inline assembly when 
targeting 64-bit.

http://code.google.com/p/openpgm/source/diff?
spec=svn1294r=1294format=sidepath=/trunk/openpgm/pgm/include/impl/ticket.h

This diff points out where the problem areas are-

pgm_atomic_add8
pgm_atomic_fetch_and_add8
pgm_atomic_inc8

pgm_atomic_add16
pgm_atomic_fetch_and_add16
pgm_atomic_inc16



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


Re: [zeromq-dev] [PATCH] Update to OpenPGM 5.1.110.

2011-03-05 Thread Alex Forster
This is /fantastic/

Some time in January, the project made a very strong push at improving the
build environment in Windows. They introduced support for CMake, which as a
developer I dislike, but as a user I very very much like. CMake makes it
incredibly easy to target Visual Studio by actually generating the .sln's and
.proj's for you.

Thank you very much. This will make Windows developers' lives much easier.

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


[zeromq-dev] Targeting ZeroMQ Interop (my C# wrapper) at ZeroMQ 2.1.0

2011-02-19 Thread Alex Forster
I'm having a hell of a time compiling ZeroMQ 2.0.10 with support for OpenPGM 
2.1.27-pre2. I got it down to 18 linker errors, and then I hit a wall because 
those errors are all related to missing MinGW libraries, and I'm using Visual 
Studio. My options now are: (1) dump Visual Studio, install the entire MinGW 
toolchain, and recompile everything introducing a MinGW dependency in the 
process, (2) compile .lib versions of the MinGW libraries since the dist 
binaries are all .a, or (3) move my project to ZeroMQ 2.1.0 which purportedly 
has ABI stability (very enticing), and support for the latest version of 
OpenPGM (thus no dependencies on glib).

I've been taking a pretty thorough look at the commit log 
(https://github.com/zeromq/zeromq2/commits/master/) and at the issue log 
(https://github.com/zeromq/zeromq2/issues/labels/master) and it seems that 
2.1.0 is very stable.

I'm looking for (1) a general idea of how far along/stable 2.1.0 is, and (2) 
some feedback on how wise a decision it is to target my wrapper library at this 
development version.
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Targeting ZeroMQ Interop (my C# wrapper) at ZeroMQ 2.1.0

2011-02-19 Thread Alex Forster
On Feb 19, 2011, at 5:50 PM, Steven McCoy wrote:

 You can add the MinGW compiler dependencies into MSVC, they're listed here as 
 libgcc.a libmingwex.a
 
 http://code.google.com/p/openpgm/wiki/OpenPgmCReferenceLinkTheseLibraryFiles

That's a very helpful page. If I can get my hands on those two I'll give it 
another shot.

 Obviously OpenPGM 5.1 is a lot easier, I even provide a Windows installer so 
 you don't have to build it yourself.

Absolutely. I'm hoping to hear something like 2.1.0 is right around the 
corner! Don't even bother with 2.0.10 anymore.___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Targeting ZeroMQ Interop (my C# wrapper) at ZeroMQ 2.1.0

2011-02-19 Thread Alex Forster
 Pieter Hintjens ph at imatix.com

Close enough to official for me.

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


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

2010-12-21 Thread Alex Forster
 Great! I would suggest adding a link to your project to www.zeromq.org. It's 
 wiki, so you can do so yourself.

Gladly, done.

 I am not familiar with CLR. Doesn't the problem the context is solving (i.e. 
 zeromq being used from two libraries that are later on linked into a single 
 application and step on each other toes) occur with .NET as well?

That is a very good question that I don't know if I can answer. I figured the 
problem it was solving essentially boiled down to no global variables. Where 
is there an opportunity for undesirable interaction?

 A side issue: Wouldn't it make sense for you clrzmq, clrzmq2, NZMQ and 
 Interop guys to at least start working on integration of all the projects? I 
 mean, writing the code is easy, maintaining it and fixing the bugs is hard. 
 If the projects are integrated into a single one you could support four time 
 more features, fix four time more bug, make the whole binding four times more 
 stable. Aside of that, having a community is much more fun than working alone 
 :)

I'd be up for it. How active is clrzmq2? NZMQ seems to have stalled 3-4 months 
ago.
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


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

2010-12-21 Thread Alex Forster
 For example, the names of inproc endpoints are stored in the context. If 
 library A uses inproc endpoint named X and library B accidentally uses 
 endpoint X as well, they start messining with each other.

That's a very good point, I'll definitely have to address that. I'm willing to 
jump through hoops to keep automatic context management, since it's such a 
perfect fit for RAII-esque language features, and API simplicity was my main 
motivation for a rewrite. Are there any other specific points of contention you 
can think off off-hand, or are there any fundamental issues that completely 
prevent it from working stably this way?
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


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

2010-12-21 Thread Alex Forster
 You do know that clrzmq2 supported all of what you mentioned besides the
 reference counting.
 
 If you had of submitted a patch for clrzmq2 it would have been very
 welcome.

I certainly didn't mean to offend. I'll admit that, while I did have some
different ideas as to what a C#-ified ZeroMQ API should look like, the biggest
motivator for my rewrite was to become more familiar with ZeroMQ. You'll notice
that the p/invoke class (ZeroMQ.Interop) is heavily documented and tested - that
was purely for my benefit.

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


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

2010-12-21 Thread Alex Forster
 I notice NUZQ seems to use lambdas, these were introduced in .NET 3.0, I
 purposely kept clrzmq2 targeting .net 2.0. 
 
 The fact is a 2.0 is the prevalent .NET framework, many large
 organization will actually only be using that. 
 
 The application I maintain as a day job is targeted at 2.0 and I work
 for a very large investment bank.

While the project requires a .NET 3.5 compiler to transform the source into IL,
the resulting assembly will run on any ECMA-334 (.NET 2.0) compatible CLI. The
new language features added to C# in 3.5 all essentially boil down to
syntactical sugar. As long as you don't reference any core assemblies that are
3.5-specific (System.Linq, System.Windows, System.ServiceModel, etc) your
resulting assembly is .NET 2.0 compatible.

http://www.hanselman.com/blog/HowDoExtensionMethodsWorkAndWhyWasANewCLRNotRequired.aspx


___
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


Re: [zeromq-dev] failed to filter topic in pub/sub

2010-04-07 Thread Alex Yu
Hi Martin,

I am using your c# binding and have another question for pub/sub.

I create a subscriber to connect to the publisher. Can the subscriber in
runtime change the topic subscriptions?
e.g. s.SetSockOpt(ZMQ.SUBSCRIBE, XXX); s.SetSockOpt(ZMQ.SUBSCRIBE, YYY);

after the socket is created and connected?

Regards,
Alex

-Original Message-
From: Martin Sustrik [mailto:sust...@250bpm.com] 
Sent: 21 March 2010 04:34
To: Alex Yu
Cc: zeromq-dev@lists.zeromq.org
Subject: Re: [zeromq-dev] failed to filter topic in pub/sub

Alex,

 I tried Jeff version and your version and can't get them work.

I cannot answer for the Jeff's version. However, for my version the 
SetSockOpt takes a simple string as a parameter:

s.SetSockOpt(ZMQ.SUBSCRIBE, );

For an example, have a look here:

http://github.com/sustrik/clrzmq/blob/master/local_thr/local_thr.cs

Martin
 

__ Information from ESET NOD32 Antivirus, version of virus signature
database 4961 (20100320) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
 

__ Information from ESET NOD32 Antivirus, version of virus signature
database 5008 (20100407) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 

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


Re: [zeromq-dev] failed to filter topic in pub/sub

2010-04-07 Thread Alex Yu
Hi Martin,

Problem solved..
I can add new subscribe and remove old subscribe in the runtime.

Thanks,
Alex

-Original Message-
From: Alex Yu [mailto:alexc...@gmail.com] 
Sent: 08 April 2010 02:27
To: 'Martin Sustrik'
Cc: 'zeromq-dev@lists.zeromq.org'
Subject: RE: [zeromq-dev] failed to filter topic in pub/sub

Hi Martin,

I am using your c# binding and have another question for pub/sub.

I create a subscriber to connect to the publisher. Can the subscriber in
runtime change the topic subscriptions?
e.g. s.SetSockOpt(ZMQ.SUBSCRIBE, XXX); s.SetSockOpt(ZMQ.SUBSCRIBE, YYY);

after the socket is created and connected?

Regards,
Alex

-Original Message-
From: Martin Sustrik [mailto:sust...@250bpm.com] 
Sent: 21 March 2010 04:34
To: Alex Yu
Cc: zeromq-dev@lists.zeromq.org
Subject: Re: [zeromq-dev] failed to filter topic in pub/sub

Alex,

 I tried Jeff version and your version and can't get them work.

I cannot answer for the Jeff's version. However, for my version the 
SetSockOpt takes a simple string as a parameter:

s.SetSockOpt(ZMQ.SUBSCRIBE, );

For an example, have a look here:

http://github.com/sustrik/clrzmq/blob/master/local_thr/local_thr.cs

Martin
 

__ Information from ESET NOD32 Antivirus, version of virus signature
database 4961 (20100320) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
 

__ Information from ESET NOD32 Antivirus, version of virus signature
database 5008 (20100407) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
 

__ Information from ESET NOD32 Antivirus, version of virus signature
database 5008 (20100407) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 

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


[zeromq-dev] failed to filter topic in pub/sub

2010-03-20 Thread Alex Yu
Hi,

 

I tried the c# binding contributed by Jeff / Martin.

 

Subscribers can get message if I didn't filter the topic.

 

But they fail to get message when I set the topic filter by specific prefix.

 

Can I filter the topics in C# like those in C/ C++ ?

s.setsockopt (ZMQ_SUBSCRIBE, xy., 3);

 

Alex

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


Re: [zeromq-dev] failed to filter topic in pub/sub

2010-03-20 Thread Alex Yu
Martin,

Attached is the code.

I tried Jeff version and your version and can't get them work.

Please see what's the problem.

Thanks,
Alex

-Original Message-
From: Martin Sustrik [mailto:sust...@250bpm.com] 
Sent: 21 March 2010 03:56
To: Alex Yu
Cc: zeromq-dev@lists.zeromq.org
Subject: Re: [zeromq-dev] failed to filter topic in pub/sub

Alex,

 I tried the c# binding contributed by Jeff / Martin.
 
  
 
 Subscribers can get message if I didn't filter the topic.
 
  
 
 But they fail to get message when I set the topic filter by specific
prefix.
 
  
 
 Can I filter the topics in C# like those in C/ C++ ?
 
 s.setsockopt (ZMQ_SUBSCRIBE, xy., 3);

You should be able to. Can you attach the piece of code that you are 
having problems with?

Martin
 

__ Information from ESET NOD32 Antivirus, version of virus signature
database 4961 (20100320) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
 

__ Information from ESET NOD32 Antivirus, version of virus signature
database 4961 (20100320) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
/*
Copyright (c) 2010 Jeffrey Dik s45...@gmail.com

This file is part of clrzmq.

clrzmq is free software; you can redistribute it and/or modify it under
the terms of the Lesser GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

clrzmq is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Lesser GNU General Public License for more details.

You should have received a copy of the Lesser GNU General Public License
along with this program.  If not, see http://www.gnu.org/licenses/.
*/
using System;
using System.Runtime.InteropServices;
using Zmq;

public class Publisher
{
public static void Main()
{
Context ctx = new Context(1, 1, 0);
Socket s = ctx.CreateSocket(SocketType.PUB);
s.Bind(tcp://127.0.0.1:);

Console.WriteLine(Port binded...);
for (long msg_id = 1; ; msg_id++)
{
using (Message msg = new Message(8)) {
Marshal.WriteInt64(msg.Data, msg_id);
s.Send(msg, 0);
long tmp = Marshal.ReadInt64(msg.Data);
if ((tmp % 1) == 0)
Console.WriteLine(tmp);
}
}
}
}
/*
Copyright (c) 2010 Jeffrey Dik s45...@gmail.com

This file is part of clrzmq.

clrzmq is free software; you can redistribute it and/or modify it under
the terms of the Lesser GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

clrzmq is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Lesser GNU General Public License for more details.

You should have received a copy of the Lesser GNU General Public License
along with this program.  If not, see http://www.gnu.org/licenses/.
*/
using System;
using System.Runtime.InteropServices;
using System.Text;
using Zmq;


public class Subscriber
{
public static void Main()
{
Context ctx = new Context(1, 1, 0);
Socket s = ctx.CreateSocket(SocketType.SUB);



string topic = 1;

IntPtr ptr = Marshal.StringToHGlobalAnsi(topic);

//Fail to use this one.
   // s.SetSockOpt(SocketOption.SUBSCRIBE, ptr, 1);

s.SetSockOpt(SocketOption.SUBSCRIBE, IntPtr.Zero, 0);
s.Connect(tcp://127.0.0.1:);

while (true)
{
using (Message msg = new Message()) {
s.Recv(msg, 0);
long msg_id = Marshal.ReadInt64(msg.Data);
 //   if ((msg_id % 1) == 0)
Console.WriteLine(msg_id);
}
}
}
}
/*
Copyright (c) 2010 Jeffrey Dik s45...@gmail.com

This file is part of clrzmq.

clrzmq is free software; you can redistribute it and/or modify it under
the terms of the Lesser GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

clrzmq is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Lesser GNU General Public License for more details.

You should have received a copy of the Lesser GNU General Public License
along with this program.  If not, see http://www.gnu.org/licenses/.
*/
using System;
using System.Runtime.InteropServices;
using System.Text;

namespace Zmq
{
internal class Zmq

[zeromq-dev] C# interface for Zmq 2.x

2010-03-17 Thread Yu, Alex (Equity Technology)
 Hi Zmq dev,
 
 I am a new user for zmq and want to make use of the zmq 2.X in my C#
 project.
 
 I found that there is not c# wrapping for zmq 2.x. Is there any C#
 wrapping for 2.x just like that in 1.x?
 
 Please let me know! Thanks!
 
 Regards,
 Alex

--
This message w/attachments (message) may be privileged, confidential or 
proprietary, and if you are not an intended recipient, please notify the 
sender, do not use or share it and delete it. The information contained in this 
e-mail was obtained from sources believed to be reliable; however, the accuracy 
or completeness of this information is not guaranteed. Unless specifically 
indicated, this message is not an offer to sell or a solicitation of any 
investment products or other financial product or service, an official 
confirmation of any transaction, or an official statement of Merrill Lynch. 
Subject to applicable law, Merrill Lynch may monitor, review and retain 
e-communications (EC) traveling through its networks/systems. The laws of the 
country of each sender/recipient may impact the handling of EC, and EC may be 
archived, supervised and produced in countries other than the country in which 
you are located. This message cannot be guaranteed to be secure or error-free. 
References to Merrill Lynch are references to any company in the Merrill 
Lynch  Co., Inc. group of companies, which are wholly-owned by Bank of America 
Corporation. Securities and Insurance Products: * Are Not FDIC Insured * Are 
Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a 
Condition to Any Banking Service or Activity * Are Not Insured by Any Federal 
Government Agency. Past performance is no guarantee of future results. 
Attachments that are part of this E-communication may have additional important 
disclosures and disclaimers, which you should read. This message is subject to 
terms available at the following link: 
http://www.ml.com/e-communications_terms/. By messaging with Merrill Lynch you 
consent to the foregoing.
--
 
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] C# interface for Zmq 2.x

2010-03-17 Thread Yu, Alex (Equity Technology)
Thanks Martin,

Of coz I would like to tried it. 
But I know nth about c++ so tried to use SWIG to generate the C#
interface last night and failed last night.

Could you send me the binding for 1.0 so that I can port it to 2.0?

Kindly Regards,
Alex

-Original Message-
From: Martin Sustrik [mailto:sust...@250bpm.com] 
Sent: Wednesday, March 17, 2010 6:12 PM
To: Yu, Alex (Equity Technology)
Cc: zeromq-...@mail.imatix.com; alexc...@gmail.com
Subject: Re: [zeromq-dev] C# interface for Zmq 2.x

Hi Alex,

 I am a new user for zmq and want to make use of the zmq 2.X in my C# 
 project.
 
 I found that there is not c# wrapping for zmq 2.x. Is there any C# 
 wrapping for 2.x just like that in 1.x?

No, the C# binding wasn't yet ported to 0MQ/2.0. However, it's a couple 
of hours' work. Would you like to give it a try?

Martin

--
This message w/attachments (message) may be privileged, confidential or 
proprietary, and if you are not an intended recipient, please notify the 
sender, do not use or share it and delete it. The information contained in this 
e-mail was obtained from sources believed to be reliable; however, the accuracy 
or completeness of this information is not guaranteed. Unless specifically 
indicated, this message is not an offer to sell or a solicitation of any 
investment products or other financial product or service, an official 
confirmation of any transaction, or an official statement of Merrill Lynch. 
Subject to applicable law, Merrill Lynch may monitor, review and retain 
e-communications (EC) traveling through its networks/systems. The laws of the 
country of each sender/recipient may impact the handling of EC, and EC may be 
archived, supervised and produced in countries other than the country in which 
you are located. This message cannot be guaranteed to be secure or error-free. 
References to Merrill Lynch are references to any company in the Merrill 
Lynch  Co., Inc. group of companies, which are wholly-owned by Bank of America 
Corporation. Securities and Insurance Products: * Are Not FDIC Insured * Are 
Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a 
Condition to Any Banking Service or Activity * Are Not Insured by Any Federal 
Government Agency. Past performance is no guarantee of future results. 
Attachments that are part of this E-communication may have additional important 
disclosures and disclaimers, which you should read. This message is subject to 
terms available at the following link: 
http://www.ml.com/e-communications_terms/. By messaging with Merrill Lynch you 
consent to the foregoing.
--
 
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev