Monday December 13, 2010

[Time] NameMessage
[12:09] mikko sustrik: hi
[12:13] sustrik hi
[12:16] mikko again, thinking out loud here: extending uris to allow shortcut for setting socket options
[12:16] mikko tcp://
[12:17] mikko although this could be done in the user application as well
[12:17] sustrik can be useful but should be implemented as a layer on top of 0mq
[12:17] sustrik exactly
[12:17] sustrik the problem is that this kind of thing means wandering far away from POSIX
[12:17] ianbarber maybe a standard function in zfl for creating sockets from a url like that?
[12:18] sustrik for example
[12:18] sustrik it's useful, so it's worth of implementing it
[12:24] sustrik mikko: btw, i've added your idea about swap->device to 3.0 roadmap
[12:24] sustrik
[12:25] mikko sustrik: cool
[12:26] mikko i was thinking about the control channel
[12:26] mikko it's not necessary to do it over a remote management
[12:26] mikko as if there was a device handle (void *) like with sockets then people could build their own if that is a requirement
[12:26] mikko lunch ->
[12:29] sustrik i don't follow
[12:29] sustrik people can build their own device even now, no?
[12:30] mrm2m Hey ho!
[12:31] ianbarber sustrik: i think the idea was to allow control flow outside the device, so the device runs in another thread, and the control is done through the parent process.
[12:32] sustrik hi
[12:32] sustrik ianbarber: sure
[12:32] sustrik what i meant was that you can do such thing even today
[12:32] mrm2m Is there a one directional socket type? I've got some data I'd like to send to a server, but I'm not interested in any message if the data was received correctly or even if it was received.
[12:33] ianbarber push
[12:33] sustrik mrm2m: PUB/SUB presumably
[12:33] sustrik it's completely uni-directional
[12:33] ianbarber sustrik: yeah, you can, but only if you create the device yourself - though I guess you could wrap a device available from elsewhere with one your own
[12:34] mrm2m Ah - I thought that was for one PUB sending to several SUBs.
[12:34] sustrik yes
[12:34] sustrik and what do you need instead?
[12:34] mrm2m I need to send from several PUBs to one SUB.
[12:34] sustrik that would work as well
[12:34] sustrik ianbarber: ah, the plan is to move devices out of 0mq core anyway
[12:35] sustrik and make them separate projects
[12:35] ianbarber ah, ok. that makes sense
[12:35] sustrik so you could have different types of devices
[12:35] sustrik the one with control socket propsed above could be one available device
[12:35] sustrik etc.
[12:35] mrm2m sustrik: Ok. Then I'll have a look on SUB/PUB.
[13:19] CIA-20 zeromq2: 03Dhammika Pathirana 07master * r22b2b9a 10/ (src/tcp_listener.cpp src/tcp_listener.hpp):
[13:19] CIA-20 zeromq2: fix overwriting errno on bind failure
[13:19] CIA-20 zeromq2: Signed-off-by: Dhammika Pathirana <> -
[14:17] ianbarber yay, that's all the zguide examples translated into php :) committed the version one I needed mikko's patch for
[14:26] mikko sustrik: pipe.cpp:56
[14:26] mikko i reckon that should exit the device rather than assert
[14:26] sustrik let me see
[14:27] sustrik i have a comment on that line :(
[14:27] sustrik can you paste the line here?
[14:27] mikko errno_assert (false);
[14:27] mikko after rc = zmq_poll (&items [0], 2, -1);
[14:27] mikko i got a signal handler in my process that catches SIGINT
[14:28] mikko it seems to however cause zmq_poll to return
[14:28] mikko and causes following assertion:
[14:28] mikko ^CInterrupted system call
[14:28] mikko false (device.cpp:56)
[14:28] mikko Aborted
[14:28] mikko if i don't catch sigint then the program exits immediately
[14:29] sustrik device or pipe.coo?
[14:29] sustrik cpp
[14:29] mikko sorry, device.cpp
[14:29] sustrik ah, have it
[14:29] sustrik yes, it works that way
[14:30] sustrik what should be presumably done
[14:30] sustrik is to return EINTR from the zmq_device call
[14:31] mikko yeah, would allow clean termination of parent program
[14:31] mikko as running device in a thread and then doing pthread_cancel doesn't seem particulary clean either
[14:32] mikko im surprised that it doesn't assert on pthread_cancel
[14:34] sustrik i assume that just kills the thread at the spot
[14:34] sustrik so it has no chance to assert
[14:37] mikko looking at the code, i think it shouldn't assert at all
[14:38] mikko as the caller can handle device exiting
[14:41] CIA-20 zeromq2: 03Dhammika Pathirana 07master * rf749f2d 10/ (src/socket_base.cpp src/socket_base.hpp):
[14:41] CIA-20 zeromq2: add basic uri validations
[14:41] CIA-20 zeromq2: Signed-off-by: Dhammika Pathirana <> -
[14:41] sustrik mikko: good point
[14:43] mikko you could even send the original errno back
[14:46] sustrik yes
[14:59] mikko sustrik:
[15:03] sustrik mikko: looks good
[15:03] sustrik can you send it as patch to the ml?
[15:20] sustrik mikko: checking your swapdir patch
[15:20] sustrik what's the point of having 3 test functions?
[15:20] sustrik + static bool test (const std::string& directory_);
[15:20] sustrik +
[15:20] sustrik + static bool test (const char* directory_);
[15:20] sustrik +
[15:20] sustrik + static bool test ();
[15:29] mikko sustrik: overloaded for different types i guess
[15:29] sustrik i mean, do you use all 3 of them?
[15:29] mikko sustrik: yes
[15:29] mikko what i think about now
[15:29] mikko does it make sense to amend the swap now
[15:29] mikko if it goes to heavy refactoring soon
[15:29] sustrik well, depends on you
[15:30] sustrik if you need it asap, i'll apply it
[15:30] mikko i don't need asap
[15:31] mikko i can work around it and document for php extension
[15:31] mikko at the moment doing const char *tmp = getenv("TMPDIR"); if (!tmp) { tmp = "/tmp"; } chdir(tmp);
[15:31] sustrik ok then
[15:32] sustrik maybe just write a comment about it on the ml
[15:32] sustrik so that people know what happened to the patch
[15:34] mikko i'll write comment and send device patch today
[15:34] sustrik ok
[17:37] mikko sustrik: call to device is not consistent between C and C++
[17:37] mikko seems to be void in C++
[17:37] mikko and int in C
[17:37] mikko return type that is
[17:39] mikko error_t is int?
[17:42] mikko no, wait. got it
[18:15] myraft complete noob - quick question - where do I start? I am not sure if I even installed it correctly. Is there a zmq on linux that should be in the path?
[18:17] myraft Nevermind - found some Java examples on Github - will scan and ask the questions again.
[18:17] myraft Thanks though.
[18:18] cremes myraft: make sure you run ldconfig so that the zmq libs get added to your linux library paths
[18:19] drbobbeaty myraft: it's probably best to read The Guide (it's that important):
[18:19] drbobbeaty It contains a lot of good information as well as a lot of examples in all kinds of languages.
[18:21] davetoo with topic exchange-like behavior :)
[18:23] cremes davetoo: that's described in the guide too ;)
[18:27] myraft thanks folks - just found the guide as well
[19:13] mikko sustrik:
[19:14] sustrik hm, that may be the problem that dhammika fixed
[19:14] sustrik i'll apply his patch tomorrow
[19:15] mikko cool
[19:15] mikko ianbarber stumbled on this with the php extension
[19:15] sustrik it's a heisenbug, right?
[19:15] mikko nope, can reproduce reliably
[19:15] sustrik ah, then it may be something different
[19:16] mikko if you take the .c file attached to the paste
[19:16] mikko compile and and
[19:16] mikko compile and run
[19:16] sustrik right
[19:16] mikko it should segfault / show memory errors
[20:32] mikko i to the b
[20:33] ianbarber m to the k
[20:40] myraft when trying to run java program I get "UnsatisfiedLinkError: no jzmq in java.library.path" - I have done ldconfig -p |grep zmq and see they so are a loaded. I have tried recompiling the code. Any ideas ?
[20:51] mikko myraft: it seems to be complaining about jzmq
[20:51] mikko rather than zmq itself
[20:52] myraft ok
[20:52] myraft but not sure how to proceed - followed the instructions -
[20:53] myraft nathanmarz - if I do ldconfig -p|grep for zmq I see along with -
[20:53] myraft I meant to direct that at mikko -
[20:54] mikko myraft: is the directory where is in java.library.path ?
[20:55] myraft mikko : is in /usr/local/lib - "sheepishly" - not sure if it is java.library.path, how do I set it ?
[20:56] mikko myraft: i've no idea tbh, i don't use java myself
[20:56] mikko myraft: what version of zeromq are you using?
[20:58] myraft mikko: 2.0.10
[20:58] mikko myraft: can you test with current github trunk?
[20:58] mikko just in case
[20:58] mikko git clone
[20:58] mikko cd zeromq2 && ./ && ./configure && make install
[21:00] myraft mikko: will do and postback - thanks
[21:04] myraft mikko - did that and see created in /usr/local/bin - running the Java program still gives the same error.
[21:04] myraft I did go thru installation instructions - and was confused about setting java.library.path - I did CLASSPATH instead in the .bashrc
[21:08] myraft I wonder if I need to restart the system - since there is libconf daemon - and that will not see the changes.
[21:08] myraft Anyways - thanks for the attempt - let me know if you have any more ideas.
[21:14] myraft I will leaving the workstation for a little bit and will be online later.
[21:19] mikko i dont think that makes a different
[21:19] mikko difference*
[21:19] mikko i can give it a go later
[21:35] mikko sustrik: still there?