[zeromq-dev] how to reliably wait for SUBscribers to connect before sending messages

2018-01-05 Thread KIU Shueng Chuan
Message: 1 Date: Fri, 5 Jan 2018 10:03:17 +0100 From: Francesco To: zeromq-dev Subject: [zeromq-dev] how to reliably wait for SUBscribers to connect before sending messages Message-ID: Content-Type: text/plain; charset="utf-8" Hi all, I have some unit tests around the ZMQ wrappe

Re: [zeromq-dev] Zmq 4.2.0 aligned memory

2016-11-14 Thread KIU Shueng Chuan
A common use case for me is sending an array of floats. First message part is some small metadata. Second message part is the float array. On reception, zmq_msg_data is cast to float* and accessed directly. This non-alignment would be problematic. Or perhaps there never was any alignment guarant

Re: [zeromq-dev] Lost message with PUSH/PULL

2016-07-01 Thread KIU Shueng Chuan
I have attached some minimal code here where doing a TCP connect to the PUSH bind socket makes the latter writable. Tested on 4.1.4 On 30 June 2016 at 23:11, Doron Somech wrote: > I think it might be the ZeroMQ behavior (which is probably a bug), once the > connection is open ZeroMQ start to que

Re: [zeromq-dev] What are the “serious caveats” with ZMQ_FD?

2016-05-02 Thread KIU Shueng Chuan
ts in the FD? So if I'm > only interested on events about incoming messages (I check only ZMQ_POLLIN > from ZMQ_EVENTS), do I need to "update the state of ZMQ_EVENTS" after both > zmq_send() and zmq_recv(), or is it enough to do it only after zmq_send()? > > -- > Kal

Re: [zeromq-dev] What are the “serious caveats” with ZMQ_FD?

2016-05-01 Thread KIU Shueng Chuan
>From the man page for zmq_getsockopt: "after calling zmq_send the socket may become readable (and vice versa) without triggering a read event on the file descriptor." On 1 May 2016 3:33 am, "Kalle Huttunen" wrote: > The ZeroMQ FAQ (http://zeromq.org/area:faq#toc5) states in the "Why can't > I u

Re: [zeromq-dev] Empty message does not close ZMQ_STREAM socket?

2016-03-22 Thread KIU Shueng Chuan
zeromq-dev-boun...@lists.zeromq.org]" im Auftrag von "Osiris Pedroso [ > opedr...@gmail.com] > *Gesendet:* Dienstag, 22. März 2016 15:03 > *An:* ZeroMQ development list; KIU Shueng Chuan > *Betreff:* Re: [zeromq-dev] Empty message does not close ZMQ_STREAM > socket? > >

Re: [zeromq-dev] Empty message does not close ZMQ_STREAM socket?

2016-03-21 Thread KIU Shueng Chuan
that this message may have been addressed to you in error, you may not use > or copy or deliver this message to anyone else. In such case, you should > destroy this message and are asked to notify the sender by reply e-mail. > -- > *Von:* zeromq-dev-boun...@list

Re: [zeromq-dev] Empty message does not close ZMQ_STREAM socket?

2016-03-21 Thread KIU Shueng Chuan
this message to such person), or you think for any reason > that this message may have been addressed to you in error, you may not use > or copy or deliver this message to anyone else. In such case, you should > destroy this message and are asked to notify the sender by reply e-mail. >

Re: [zeromq-dev] Empty message does not close ZMQ_STREAM socket?

2016-03-21 Thread KIU Shueng Chuan
There's something in the manpage that your code doesn't do. > To open a connection to a server, use the zmq_connect call, and then fetch the socket identity using the ZMQ_IDENTITY zmq_getsockopt call. I don't recall if this was strictly necessary but I see in my code that I did fetch the identity

Re: [zeromq-dev] level-triggered FD

2016-01-26 Thread KIU Shueng Chuan
I don't see how this can be the case since zmq_poll() internally uses ZMQ_FD to implement level triggering for zmq sockets. https://github.com/zeromq/zeromq4-1/blob/master/src/zmq.cpp On 27 Jan 2016 02:59, "Justin Karneges" wrote: > Also beware that inproc sockets are broken with ZMQ_FD. > https

Re: [zeromq-dev] ZeroMQ 4.1.4 stable is now available

2016-01-15 Thread KIU Shueng Chuan
I encountered this problem yesterday too. It's been fixed in: https://github.com/zeromq/zeromq4-1/commit/b9dbc5b8caea5491c7330d891e93e2791d84c906 So 4.1.4 will no longer work on WinXP. On 16 Jan 2016 03:08, "Tom Quarendon" wrote: > OK, I'll try that out. > Thanks. > > -Original Message- >

Re: [zeromq-dev] 64bit Issue discovered with zmq_getsockopt(..., ZMQ_RCVMORE, ...

2015-12-12 Thread KIU Shueng Chuan
The type of that socket option was changed to "int" since version 3.2.x Rather than extracting the more flag using getsockopt, you can also do: int more = zmq_msg_more (&part); On 13 Dec 2015 03:01, "Jeff Shanab" wrote: > Using ZMQ 4.0.4 on windows 64bit in Visual studio with a simple REQ-REP >

Re: [zeromq-dev] zmq_msg_recv not blocking

2015-11-23 Thread KIU Shueng Chuan
Note that zmq_msg_recv() returns >= 0 on success. On 23 Nov 2015 19:54, "Jeff Shanab" wrote: > I have used a previous version of zmq with google protocol buffers a few > years ago but am trying a simpler project with the newest zmq and have run > into a problem. > > Imagine the weather server and

Re: [zeromq-dev] zmq_poll when socket is closed

2015-10-13 Thread KIU Shueng Chuan
I didn't run your example but isn't the zmq_poll() call going to return immediately before the 5 seconds are up? POLLOUT indicates writability which is true for zmq sockets until the hwm is reached. On 13 Oct 2015 23:50, "Auer, Jens" wrote: > Hi, > > what is the semantics of zmq_poll when the re

Re: [zeromq-dev] zeroMQ version with ZMQ_STREAM_NOTIFY

2015-09-24 Thread KIU Shueng Chuan
reply e-mail. > > > > *From:* zeromq-dev-boun...@lists.zeromq.org [mailto: > zeromq-dev-boun...@lists.zeromq.org] *On Behalf Of *KIU Shueng Chuan > *Sent:* 24 September 2015 11:17 > *To:* ZeroMQ development list > *Subject:* Re: [zeromq-dev] zeroMQ version with ZMQ_STREAM_NOTIFY

Re: [zeromq-dev] zeroMQ version with ZMQ_STREAM_NOTIFY

2015-09-24 Thread KIU Shueng Chuan
It appeared in 4.2.x The summary here may be useful: https://github.com/zeromq/libzmq/pull/1487 On 24 Sep 2015 16:38, "Auer, Jens" wrote: > Hi, > > I am writing an application which uses ZMQ_STREAM sockets to provide an > interface to non-zeromq applications on raw sockets. I know that there > h

Re: [zeromq-dev] 64bit error setting socket linger value.

2015-09-05 Thread KIU Shueng Chuan
"sizeof (&linger)" should be "sizeof (linger)" ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Re: [zeromq-dev] Disable resend of Publisher after reconnection

2015-08-28 Thread KIU Shueng Chuan
ve_probes); > assert(rc == 0); > rc = zmq_setsockopt(publisher, ZMQ_TCP_KEEPALIVE_INTVL, &alive_intvl, > sizeof alive_intvl); > assert(rc == 0); > > Am 27.08.2015 um 15:13 schrieb KIU Shueng Chuan: > > You could use the tcp keepalive socket options to make the tcp connection

Re: [zeromq-dev] Disable resend of Publisher after reconnection

2015-08-27 Thread KIU Shueng Chuan
You could use the tcp keepalive socket options to make the tcp connection drop faster once you have unplugged your cable. That should cause the queued packets to be dropped. Or your subscriber could drain the socket of messages by reading it until it would block and only process the last one. On A

Re: [zeromq-dev] Building & using ZeroMQ with Visual Studio

2015-08-20 Thread KIU Shueng Chuan
Could you try editing src/config.hpp, change the line signaler_port from 5905 to 0 and recompile? On 20 Aug 2015 14:13, "Matt Bolger" wrote: > Some further digging in case this mean something to someone: > > I *think* the issue can be traced back to zmq::signaler_t::make_fdpair() - > line 447 > >

Re: [zeromq-dev] Building & using ZeroMQ with Visual Studio

2015-08-18 Thread KIU Shueng Chuan
Hmm, I have only used up to 4.1.2 on Windows. ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Re: [zeromq-dev] Building & using ZeroMQ with Visual Studio

2015-08-18 Thread KIU Shueng Chuan
Is your application calling select() on a zmq socket? Zmq sockets are not (directly) select()-able. You would normally use zmq_poll() instead. On Wed, Aug 19, 2015 at 8:08 AM, Matt Bolger wrote: > Hi All, > > > > Anyone out there successfully building/using ZeroMQ under Windows (MSVC)? > > > > I

Re: [zeromq-dev] CZMQ and Server and Client Sockets

2015-08-17 Thread KIU Shueng Chuan
If the pollfd is level triggered, then we could just use the system poll/select directly. Then check all thread safe zsocks attached to the pollfd for ZMQ_EVENTS. It would thus be trivial to use thread safe zsocks with other event loops. If pollfd is level triggered, that is. _

Re: [zeromq-dev] CZMQ and Server and Client Sockets

2015-08-17 Thread KIU Shueng Chuan
Is this new pollfd level triggered or edge triggered? ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Re: [zeromq-dev] CZMQ and Server and Client Sockets

2015-08-17 Thread KIU Shueng Chuan
> (right now it is not public). > I will make the change. > > What disadvantage do you see to the change of the structure? > > On Mon, Aug 17, 2015 at 6:11 AM, KIU Shueng Chuan > wrote: > >> Do you think it would be worthwhile to preserve ABI compatibility of the >

Re: [zeromq-dev] CZMQ and Server and Client Sockets

2015-08-16 Thread KIU Shueng Chuan
pull/1526 > > On Sun, Aug 16, 2015 at 5:54 PM, Doron Somech wrote: > >> I will try to fix that... >> >> On Sun, Aug 16, 2015 at 5:43 PM, KIU Shueng Chuan >> wrote: >> >>> Hello, the new definition for zmq_pollitem_t would break code like the >>

Re: [zeromq-dev] CZMQ and Server and Client Sockets

2015-08-16 Thread KIU Shueng Chuan
Hello, the new definition for zmq_pollitem_t would break code like the following: zmq_pollitem_t pollitems [] = { { zsock, 0, ZMQ_POLLIN, 0 }, { NULL, fd, ZMQ_POLLIN, 0 } }; On 16 Aug 2015 19:10, "Doron Somech" wrote: > So I made a pull request which add polling o

Re: [zeromq-dev] CZMQ related travis failures

2015-08-16 Thread KIU Shueng Chuan
I think it's because zmq_pollitem_t has very recently gained a new "poller" field. Perhaps that new field should be moved to the end? On 16 Aug 2015 22:06, "Brian Knox" wrote: > Joe - that's what I'm thinking too. > > On Sun, Aug 16, 2015 at 9:59 AM, Joe McIlvain > wrote: > >> Could be that Trav

Re: [zeromq-dev] ZeroMQ & Raspberry Pi (Debian)

2015-08-14 Thread KIU Shueng Chuan
Fwiw, I recently tried zeromq 4.1.2 with raspberry pi B. How about compiling zeromq from source and running the test suite? One test failed intermittently but that was due to the slowness of the pi, I think. On 15 Aug 2015 00:00, "Kelly Beard" wrote: > I tried compiling a couple of samples from

Re: [zeromq-dev] cannot send big chunk via PUSH/PULL by pyzmq

2015-05-11 Thread KIU Shueng Chuan
s instead?) On Tue, May 12, 2015 at 12:40 PM, Li Ma wrote: > I just created a list filled by 2 million zero and sended it out. Any > problems? > > On Sun, Apr 26, 2015 at 8:27 PM, KIU Shueng Chuan > wrote: > > I read your code as sending a multipart message composed of 2 mi

Re: [zeromq-dev] cannot send big chunk via PUSH/PULL by pyzmq

2015-04-26 Thread KIU Shueng Chuan
I read your code as sending a multipart message composed of 2 million parts each of size 1 byte. Is that right? On Apr 26, 2015 16:50, "Li Ma" wrote: > On Thu, Apr 23, 2015 at 7:50 PM, Pieter Hintjens wrote: > > - please provide your test case as a minimal program > > Sure. > > Server part: > co

Re: [zeromq-dev] ZeroMQ with Python and a basic task

2015-03-07 Thread KIU Shueng Chuan
Isn't the system python in redhat 7 python 2.7? Are you installing libraries in python 2.7 and trying to run your script in python 2.6.6? "yum install python-devel" would be installing for python 2.7 for instance. If you don't need to use zeromq 4.x, redhat's repository should include both pyzmq

Re: [zeromq-dev] ZMQ vs SPI: FD shenanigans

2015-01-21 Thread KIU Shueng Chuan
Are you sure that the ioctl call failed? You are printing out errno without having checked the return code of the ioctl call. Hello, Am 20.01.2015 22:02, schrieb Arnaud Kapp: -Snipp- >> On Tue, Jan 20, 2015 at 11:32 AM, Olaf Mandel >> wrote: -Snipp- >>> Good point, my machine and version numbers

Re: [zeromq-dev] CZMQ selftest build fails.

2015-01-07 Thread KIU Shueng Chuan
By the way, the reason such defines appear is to attempt to distinguish between mingw32 and mingw64. Both define __MINGW32__ but unfortunately their implementation differs slightly usually in the header files. Sometimes people patch the code to work with mingw64 but that breaks mingw32 (and vice v

Re: [zeromq-dev] How to convert socket_t* to void *zocket so that I can integrate Strawhouse czmq to my c++ ZeroMQ project?

2014-12-15 Thread KIU Shueng Chuan
Try: zsocket_set_zap_domain ((void*)(*m_socket_ptr), "global"); Both the zmq::context_t and zmq::socket_t implement operator void*() which return the underlying libzmq context and socket void* handles. ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.

Re: [zeromq-dev] How to use ZeroMQ context with zauth?

2014-12-15 Thread KIU Shueng Chuan
zctx_t *ctx_ptr = zctx_shadow_zmq_ctx ((void *)context); should do what you want. On 16 Dec 2014 06:29, "Check Peck" wrote: > I need to use ZeroMQ context from C++ binding to C way of ZeroMQ context > so when I do it like this, I get a Segmentation fault > > zctx_t* ctx_ptr = static_cast((vo

Re: [zeromq-dev] EOF on file transfer

2014-12-09 Thread KIU Shueng Chuan
"range (offsets+1)" should just be "range (offsets)". "filename.seek (offset)" should be "filename.seek (offset * chunksize)" Try doing a local file copy with your loop first. The problem in your code is not with zeromq. On 10 Dec 2014 00:47, "Tiago Hillebrandt" wrote: > Hey guys, > > I am using

Re: [zeromq-dev] libzmq mingw32 build fails

2014-11-19 Thread KIU Shueng Chuan
There's an old thread about cross compiling with mingw32 here: https://github.com/zeromq/czmq/issues/104 ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Re: [zeromq-dev] zmq_getsockopt issue with ZMQ_FD

2014-11-03 Thread KIU Shueng Chuan
"rc != -1" usually means success. Your code snippet also doesn't initialize "fd_size". On Tue, Nov 4, 2014 at 6:54 AM, Saurav Dasgupta wrote: > I am facing some problem in retrieving the socket associated with the > subscriber. > In my case, the subscriber is spawned before the Publisher. > rc

Re: [zeromq-dev] API break in 4.1.x

2014-10-25 Thread KIU Shueng Chuan
http://lists.zeromq.org/pipermail/zeromq-dev/2014-April/025977.html See referred thread. Without the reconnection notification, it would not be possible to receive and assemble large messages from the server. On 26 Oct 2014 03:09, "Pieter Hintjens" wrote: > Hi all, > > We've noticed this commit

Re: [zeromq-dev] Lazy subscriber, only receive last message

2014-10-15 Thread KIU Shueng Chuan
Would the zmq4 socket option ZMQ_CONFLATE do what you want? ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Re: [zeromq-dev] Python to C++ PUB-SUB Socket

2014-10-08 Thread KIU Shueng Chuan
You didn't seem to have set any subscriptions on your SUB sockets. I also seem to recall that binding to localhost doesn't work. Bind to 127.0.0.1 instead. Connecting to localhost does work though. ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org

Re: [zeromq-dev] ZMQ_POLLIN received on WRITE event

2014-09-25 Thread KIU Shueng Chuan
Your code could be stripped down a lot: 1) PUB socket is only for sending. There's no need to test it for ZMQ_POLLIN. 2) PUB socket never blocks when sending. There's no need to test it for ZMQ_POLLOUT. 3) SUB socket is only for receiving. There's no need to test it for ZMQ_POLLOUT. 4) The ZMQ_FDs

Re: [zeromq-dev] ZMQ_POLLIN received on WRITE event

2014-09-24 Thread KIU Shueng Chuan
Don't check the FD for writability. You are only meant to check for its readability. ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Re: [zeromq-dev] Trouble sending from ROUTER to DEALER

2014-09-18 Thread KIU Shueng Chuan
zmq_msg_init_size(&messageOut, sizeof id ); memcpy(zmq_msg_data(&messageOut), &id, sizeof id); In the above 2 lines in your multipartmsg.h, replace "sizeof id" with "id.size()" and "&id" with "id.data()". ___ zeromq-dev mailing list zeromq-dev@lists.zer

Re: [zeromq-dev] Trouble sending from ROUTER to DEALER

2014-09-18 Thread KIU Shueng Chuan
. Works without knowing that auto generated identities are of any > specific size. > > > > Stuck. > > > > Riskybiz. > > > > Date: Tue, 16 Sep 2014 22:45:52 +0800 > > From: KIU Shueng Chuan > > Subject: Re: [zeromq-dev] Trouble sending from

Re: [zeromq-dev] Trouble sending from ROUTER to DEALER

2014-09-17 Thread KIU Shueng Chuan
You already use a std::string to store the non-identity parts of the multi-part message. Why not use the same data type for the identity part? The identity and non-identity parts are just data blobs. ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.or

Re: [zeromq-dev] Trouble sending from ROUTER to DEALER

2014-09-16 Thread KIU Shueng Chuan
In your multipartmsg.h file, you have code that does the following: int32_t id = *(static_cast(zmq_msg_data(&messageIn))) You have assumed that the auto generated identity is 4 bytes long, whereas it is in fact 5 bytes long. So when sending a reply, you would have sent a truncated identity, which

Re: [zeromq-dev] zsocket_set_identity(), crash!

2014-09-16 Thread KIU Shueng Chuan
Try zsock_set_identity() instead of zsocket_set_identity(). ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Re: [zeromq-dev] Trouble sending from ROUTER to DEALER

2014-09-15 Thread KIU Shueng Chuan
e of identity: > 32bits > > > > router: Ready to receive > > > > > > Date: Mon, 15 Sep 2014 10:44:46 +0800 > > From: KIU Shueng Chuan > > Subject: Re: [zeromq-dev] Trouble sending from ROUTER to DEALER > > To: ZeroMQ development list > > Message-I

Re: [zeromq-dev] Trouble sending from ROUTER to DEALER

2014-09-14 Thread KIU Shueng Chuan
You may want to check whether the received identity frame is only 32-bits in length. On 15 Sep 2014 02:30, "Riskybiz" wrote: > Dear zeromq developers, > > > > I've created a couple of simple Windows C++ console programs > zmqDealerClient & zmqRouter >

Re: [zeromq-dev] zyre and zmq_poll problem

2014-09-11 Thread KIU Shueng Chuan
zmq_poll() takes libzmq void* sockets not zsock_t* that is the type of your nodesock. A web search of errno 88 says it's ENOTSOCK. On 11 Sep 2014 20:04, "Sridhar Anandakrishnan" wrote: > > Hi, I am trying to poll on a zyre socket and it returns immediately with > errno set to 88. > > zyre versio

Re: [zeromq-dev] Paranoid Pirate

2014-08-26 Thread KIU Shueng Chuan
Surely Paranoid Pirate pattern must > have > worked with uuids at some point in time otherwise how would it have passed > muster for the zeromq guide? > > Confused. > > Riskybiz. > > > Message: 8 > Date: Tue, 26 Aug 2014 06:15:54 +0800 > Fro

Re: [zeromq-dev] Paranoid Pirate

2014-08-25 Thread KIU Shueng Chuan
t; > . > > I have changed int64_t more = 0; to int more = 0; as kindly pointed out > by KIU Shueng Chuan as being necessary for zeromq-3.2.x and higher. Also > added are some console print statements to trace what is actually going > on. In order to correct very long waiting

Re: [zeromq-dev] Zeromq Paranoid Pirate & Majordomo examples.

2014-08-23 Thread KIU Shueng Chuan
In your req2Router.cpp file, the RCVMORE socket option uses int64_t. It changed from int64_t in zmq 2.2 to int in zmq 3.2.x and later. On 24 Aug 2014 04:53, "Riskybiz" wrote: > Dear 0MQ developers, > > > > For some months I've been trying to get the Paranoid Pirate & Majordomo > patterns working

Re: [zeromq-dev] Query on zmq_poll API

2014-08-19 Thread KIU Shueng Chuan
. I do have poll_items[1] > initialized. > Do you see any issue why zmq_poll API just returns only the first message > received on each socket. > > Thanks > Badhri > > Sent from my iPhone > > On Aug 18, 2014, at 5:31 PM, KIU Shueng Chuan wrote: > > Your snippet n

Re: [zeromq-dev] Query on zmq_poll API

2014-08-18 Thread KIU Shueng Chuan
Your snippet neither initializes nor checks poll_items[1]. But no, revents field doesn't need to be reset (nor initialized). On Tue, Aug 19, 2014 at 8:14 AM, Badhrinath Manoharan wrote: > Hi, > > I have the following topology > > Client ---> Broker > Server > > Both the client and server ar

Re: [zeromq-dev] zmq "send" question

2014-08-10 Thread KIU Shueng Chuan
It resets the zmq_msg_t structure to an initialized state. On 11 Aug 2014 05:59, "Chrys Mischa Piva" wrote: > hello, > > I believe I read somewhere that zeromq deletes the memory for a message > after calling "send" ... > > can someone either tell me I am wrong or point me to the documentation fo

Re: [zeromq-dev] Extending zmq_msg_t API

2014-07-09 Thread KIU Shueng Chuan
Couldn't the refcount change after you have obtained its value? E.g. Make a copy Send the 1st Read the refcount (2) Background io releases 1st copy On 9 Jul 2014 18:21, "Thomas Rodgers" wrote: > zmq_msg_get() could be extended to give either the refcount or an > indicator on whether a message wa

Re: [zeromq-dev] PeriodicCallback timeout?

2014-07-04 Thread KIU Shueng Chuan
ages when there >> are messages to be sent. >> > > However, I don't get this part. How is it different than directly invoking > stream.send_multipart(msg) ? > > >> >> -MinRK >> >> >> >> On Thu, Jul 3, 2014 at 7:07 AM, KIU Shueng Chua

Re: [zeromq-dev] PeriodicCallback timeout?

2014-07-03 Thread KIU Shueng Chuan
How about replacing the Queue with zmq sockets? Then you could just add the "consumer" socket to the event loop. On 3 Jul 2014 16:15, "Indradhanush Gupta" wrote: > Hello, > > I am using a PeriodicCallback in pyzmq, that checks a python Queue for > data that needs to be sent. > > It looks like thi

Re: [zeromq-dev] API changes from 4.0 to 4.1

2014-06-20 Thread KIU Shueng Chuan
There was a behavior change in 4.1 for ZMQ_STREAM sockets returning an empty message upon client connect and/or disconnect. On 20 Jun 2014 18:42, "Pieter Hintjens" wrote: > Can you explain what tests fail? There's no list of API changes though > I can make one. > > -Pieter > > On Fri, Jun 20, 201

Re: [zeromq-dev] Message initialisation

2014-05-01 Thread KIU Shueng Chuan
> zmq_msg_close() does not return with an error code when applied to an > "empty" zmq_msg_t, neither one that has just been sent nor one that has > been initialised as empty. However, if I call it *again* on the same > message, it fails: > > zmq_msg_t m; > zmq_msg_init(&m); > assert

Re: [zeromq-dev] 0MQ 4 - how to detect closed stream socket ?

2014-04-25 Thread KIU Shueng Chuan
Fri, Apr 25, 2014 at 11:52 PM, KIU Shueng Chuan > wrote: > > It turns out that this functionality was added in January to libzmq. > > An empty message is sent both on connect and also upon disconnect. > > > > The net effect for my use case is that one receives 2 empty me

Re: [zeromq-dev] 0MQ 4 - how to detect closed stream socket ?

2014-04-25 Thread KIU Shueng Chuan
that demonstrate the behavior (A tcp publisher subscribed using zmq_stream): https://github.com/pijyoi/test_zmqstream On Thu, Apr 24, 2014 at 6:40 PM, Pieter Hintjens wrote: > On Thu, Apr 24, 2014 at 12:35 PM, KIU Shueng Chuan > wrote: > > > Sadly, I am dealing with "publish

Re: [zeromq-dev] 0MQ 4 - how to detect closed stream socket ?

2014-04-24 Thread KIU Shueng Chuan
server without a request from the client first. That is, if the server > is sending 10K bytes and the connection is broken, the client will get > nothing more until it decides the connection is "dead" and then > reconnects. > > -Pieter > > On Thu, Apr 24, 2014 at

Re: [zeromq-dev] 0MQ 4 - how to detect closed stream socket ?

2014-04-23 Thread KIU Shueng Chuan
I am trying out ZMQ_STREAM and it's great that (re)-connects are handled asynchronously. However... Say a TCP server sends out 1-byte messages such that multiple recv()s are required to get the whole message. A ZMQ_STREAM client receives 1500 bytes and then the connection gets broken. (E.g. se

Re: [zeromq-dev] Try to run a very simple example wih pyzmq and multiprocessing

2014-03-28 Thread KIU Shueng Chuan
Don't pass "context" to the child process. Create another context in the child. ZeroMQ objects don't work well across forks. On Thu, Mar 27, 2014 at 10:42 PM, SUDRES Xavier wrote: > I'm trying to run a very simple example code using pyzmq and > multiprocessing. I just want to have two threads

Re: [zeromq-dev] assertion failed "Access Denied" in (bundled\zeromq\src\signaler.cpp:318)

2014-03-15 Thread KIU Shueng Chuan
The assertion on line 318 is due to failure to open an Event used for synchronization. While I do not know why that would be the case, if you are able to use libzmq master, the code there allows you to avoid using this synchronization Event, which might help in your case. In libzmq master, edit co

Re: [zeromq-dev] Assertion fails in zmq.hpp line 267 when running C++ hello world client and server

2014-03-12 Thread KIU Shueng Chuan
Sorry, the second one should have been context (1, 63) instead of 64. A better solution would be to fix zmq.hpp to not set max sockets option if the user didn't pass in a 2nd parameter to the constructor. ___ zeromq-dev mailing list zeromq-dev@lists.zero

Re: [zeromq-dev] Assertion fails in zmq.hpp line 267 when running C++ hello world client and server

2014-03-12 Thread KIU Shueng Chuan
Try instantiating context_t with context(1, 1023). If that still fails try context(1, 64). On 13 Mar 2014 03:35, "Johnathon Ender" wrote: > Hello, > > > > I have been attempting to run a C++ instance of the hello world client and > server in Visual Studio 2010 on a Windows 7 machine. I have taken

Re: [zeromq-dev] How should sockets be destroyed?

2014-02-25 Thread KIU Shueng Chuan
Is this related to the following issue? https://github.com/zeromq/libzmq/issues/792 In the issue, the problem only occurs with inproc transport, as also used by you. On 25 Feb 2014 16:36, "Laurent Alebarde" wrote: > You are right. Possibly a bug in the lib ? > > Le 24/02/2014 18:13, Olaf Mandel

Re: [zeromq-dev] default MAX_SOCKETS on Windows set to 63?

2014-02-17 Thread KIU Shueng Chuan
alue when run in a mingw32 build host. > > > On Feb 17, 2014, at 5:42 PM, KIU Shueng Chuan wrote: > > Looking at the ctx.cpp source, setting of MAX_SOCKETS goes through > clipped_maxsocket() which clips it to "max_fds()-1", where max_fds() is > equal to FD_SETSIZE a

Re: [zeromq-dev] default MAX_SOCKETS on Windows set to 63?

2014-02-17 Thread KIU Shueng Chuan
I've tried a few different ways of providing FD_SETSIZE but nothing has > worked for me so far. > > I have tried: > > * CFLAGS=-DFD_SETSIZE=1024 ./configure > > * CPPFLAGS=-DFD_SETSIZE=1024 ./configure > > Neither one is picked up properly by the system. What else shoul

Re: [zeromq-dev] default MAX_SOCKETS on Windows set to 63?

2014-02-14 Thread KIU Shueng Chuan
https://github.com/zeromq/czmq/issues/104 If compiling using the configure script you need to provide FD_SETSIZE. On 15 Feb 2014 01:28, "Charles Remes" wrote: > I received a bug report from a user who compiled zeromq 4.0.3 on Windows > using 32-bit mingw. The code that blew up was: > > context =

Re: [zeromq-dev] Inter thread communication for scalability

2014-01-15 Thread KIU Shueng Chuan
During socket shutdown, with linger set to 0, messages in-flight would be dropped? I use synchronized queues to hold the buffer pointers like the OP but use zeromq to send a signal to the consumer thread to pop a buffer from the queue. On 15 Jan 2014 22:06, "Goswin von Brederlow" wrote: > On Tue

Re: [zeromq-dev] Problem with zeromq and large messages

2014-01-03 Thread KIU Shueng Chuan
BTW, zmq_recv is implemented using zmq_msg_recv and memcpy, so you get the same number of mallocs and frees in addition to an extra copy. ___ 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 KIU Shueng Chuan
What should be the behavior if the user specifies 1500ms but the underlying OS only supports seconds granularity? ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Re: [zeromq-dev] Bug report for zeromq

2013-12-19 Thread KIU Shueng Chuan
Mkstemp() opens the file so there is a file descriptor leak in the patch. Not sure if you are allowed to bind to an existing regular file either. ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Re: [zeromq-dev] Blocking after 2000 sent messages

2013-12-18 Thread KIU Shueng Chuan
00" (blocking send) - same as when the HWMs aren't > set. > > On Wed, Dec 18, 2013 at 4:03 PM, KIU Shueng Chuan > wrote: > > For inproc, the effective hwm is the sum of the send and recv hwm. > Default > > of 1000 per side gives 2000. > > > > To set

Re: [zeromq-dev] Blocking after 2000 sent messages

2013-12-18 Thread KIU Shueng Chuan
For inproc, the effective hwm is the sum of the send and recv hwm. Default of 1000 per side gives 2000. To set hwm to unlimited, you would need to set both send and recv hwm to 0. You didn't say at which number it blocks after you set only the send hwm to 0. On Dec 19, 2013 5:20 AM, "Garrett Smith

[zeromq-dev] signaler::send() called after signaler::~signaler()

2013-12-12 Thread KIU Shueng Chuan
Hi All, While trying to get mingw32-compiled czmq selftest to run under wine, I occasionally get a "Bad file number" assertion triggered by zauth selftest. The assertion occurs in signaler_t::send(). Adding some printfs indicate that the send() method is being called *after* the signaler object h

Re: [zeromq-dev] zmq_msg_move

2013-12-11 Thread KIU Shueng Chuan
9, 2013 at 3:23 PM, KIU Shueng Chuan > wrote: > > 1) yes, needed. > > 2) yes, it should. After the move, the origin message returns to an > init-ed > > state. You could get away with not closing, but in my opinion that > relies on > > knowing the underlying implem

Re: [zeromq-dev] Blocking issues with signaler_t::make_fdpair

2013-12-10 Thread KIU Shueng Chuan
e scenarios I've described in > my first mail. What do you think? > > Koby > > > On Tue, Dec 10, 2013 at 12:37 AM, KIU Shueng Chuan wrote: > >> I believe no permission is needed to do a pull request. :) >> >> Upon rereading Koby's mail more closely, h

Re: [zeromq-dev] Blocking issues with signaler_t::make_fdpair

2013-12-09 Thread KIU Shueng Chuan
run the > modification in the same environment where the problem was happening)? > > Em 01/12/2013 21:27, KIU Shueng Chuan escreveu: > > In master, you can switch to using ephemeral ports by modifying > signaler_port to 0 in config.hpp. A new ephemeral port is used per > make_fdpair

Re: [zeromq-dev] zmq_msg_move

2013-12-09 Thread KIU Shueng Chuan
1) yes, needed. 2) yes, it should. After the move, the origin message returns to an init-ed state. You could get away with not closing, but in my opinion that relies on knowing the underlying implementation. 3) yes. However in this case, closing the origin message is mandatory. (Unless you also kno

Re: [zeromq-dev] czmq_selftest fails after fresh clone

2013-12-09 Thread KIU Shueng Chuan
You should be right that the 64-bit alignment assertion is bogus. Even the openssl manpage of sha1_update doesn't mention any alignment requirements. The czmq included version doesn't seem to have any requirement either. ___ zeromq-dev mailing list zeromq

Re: [zeromq-dev] czmq_selftest fails after fresh clone

2013-12-08 Thread KIU Shueng Chuan
The assertion is raised in the selftest of zfile. The problem is in zchunk, used by zfile_digest() which uses zdigest_update(). On a 32-bit platform, sizeof(zchunk_t) is 12-bytes. Based on the memory allocation method in zchunk_new(), the data buffer would then only be 32-bit aligned. I suppose t

Re: [zeromq-dev] Blocking issues with signaler_t::make_fdpair

2013-12-01 Thread KIU Shueng Chuan
In master, you can switch to using ephemeral ports by modifying signaler_port to 0 in config.hpp. A new ephemeral port is used per make_fdpair call and no critical section is used. Could you try that and see if it solves your problems? On Dec 1, 2013 9:39 PM, "Koby Boyango" wrote: > Hi > I'm fai

Re: [zeromq-dev] A questiion about signaler_t::make_fdpair on Windows

2013-11-27 Thread KIU Shueng Chuan
Some relevant threads: http://grokbase.com/t/zeromq/zeromq-dev/119vymt31j/zmq-occupies-random-tcp-ports-on-windows http://lists.zeromq.org/pipermail/zeromq-dev/2013-May/021457.html It seems that one person (Michal) was affected by the original use of ephemeral ports. Others prefer to just repatc

Re: [zeromq-dev] zmq::signaler_t::make_fdpair hangs application on crash

2013-11-18 Thread KIU Shueng Chuan
There were in fact 3 fixes addressing win32 issues in signaler.cpp between 3.2.2 and 3.2.4. https://raw.github.com/zeromq/zeromq3-x/master/NEWS ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Re: [zeromq-dev] pyzmq use ioloop the threading version work and the multiprocessing can't work

2013-11-18 Thread KIU Shueng Chuan
In threading module, the __init__() method is executed by the parent thread. Only the run() method executes in the newly spawned thread. So you should create the context in the run() method. Since multiprocessing module follows the threading module interface, I suppose the same thing applies. On

Re: [zeromq-dev] zmq::signaler_t::make_fdpair hangs application on crash

2013-11-13 Thread KIU Shueng Chuan
ed to check if the Event is present. >> >> Em 11/11/2013 11:16, Felipe Farinon escreveu: >> >> Ok. >> >> Seems reasonable to me and I think that a 4 seconds timeout is fine. The >> only scenario where I could imagine that this would break is if some heavy >&

Re: [zeromq-dev] zmq::signaler_t::make_fdpair hangs application on crash

2013-11-12 Thread KIU Shueng Chuan
seconds timeout is fine. The > only scenario where I could imagine that this would break is if some heavy > socket creation is going on and IFF the WaitForSingleObject wakeup order > for Events is not FIFO. > > Em 11/11/2013 11:02, KIU Shueng Chuan escreveu: > > Realistically, I t

Re: [zeromq-dev] zmq::signaler_t::make_fdpair hangs application on crash

2013-11-11 Thread KIU Shueng Chuan
Realistically, I think only bind, accept and connect have a chance of failing. The rest of the asserts just test for programming errors. Accept and connect are already handled. What's left is handling bind error. ___ zeromq-dev mailing list zeromq-dev@lis

Re: [zeromq-dev] zmq::signaler_t::make_fdpair hangs application on crash

2013-11-09 Thread KIU Shueng Chuan
The problem with simply switching to using Mutex is that it would break compatibility with older versions using an Event. I tried coding a backwards compatible version. https://github.com/pijyoi/libzmq/blob/eventhang/src/signaler.cpp It first locks using a Mutex, then locks again using the old Eve

Re: [zeromq-dev] Question about zmq_recv len and truncate

2013-10-11 Thread KIU Shueng Chuan
zmq_recv() doesn't really receive directly into your buffer, it just does the copying from a zmq_msg_t to your buffer. It was probably created to mimic the BSD sockets API. You could prevent out-of-memory with socket option of ZMQ_MAXMSGSIZE. On Sat, Oct 12, 2013 at 4:45 AM, Bruno D. Rodrigues <

Re: [zeromq-dev] CZMQ Visual Studio

2013-10-07 Thread KIU Shueng Chuan
Hi, I just tried creating an x86 MSVC import lib for a libzmq.dll generated by MINGW32 on 32-bit Windows. I did get it to work. I imagine cross-compiled, 64-bit versions and libczmq.dll would work too. There's no C++ name mangling issue since libzmq exports a C interface. The errors you encounter

Re: [zeromq-dev] CZMQ Windows: zmutex_try_lock()

2013-10-04 Thread KIU Shueng Chuan
I made a comment on this at: https://github.com/zeromq/czmq/commit/d44e4dbbfda10c8458d4d48e1c8925f3b6fd354c On Oct 4, 2013 3:32 PM, "HG Choi" wrote: > To Developers, > > I have recently just built the latest ZMQ and CZMQ for Windows x86_64 > using x86_64_w64-mingw32 toolset from an Ubuntu Linux

Re: [zeromq-dev] Version 4.0 release fork

2013-09-25 Thread KIU Shueng Chuan
You could generate the import library from the provided libsodium-4.def file per the instructions at http://www.mingw.org/wiki/MSVC_and_MinGW_DLLs. libsodium seems to build fine using MinGW's msys, yielding the same output as what comes in the pre-compiled tarball. make check passes. On Mon, Se

  1   2   >