Re: [zeromq-dev] An interesting use-case for EdgeNet : Asynchronous IRC?
Here's my current attempt at an edgenet messaging app - https://github.com/spro/Vector All that works right now is shouting into a shared room, but it's using the edgenet design of UDP presence beacons & individual dealer -> router connections to achieve that. I wasn't sure how to go about compiling zyre into the project but it attempts to use the proper ZRE beacon format. (The messaging protocol doesn't comply at all (yet)) On Mon, Jan 6, 2014 at 4:03 PM, Pieter Hintjens wrote: > Interesting. There are so many avenues for fun stuff. Right now the > challenge is just to get the basic libzmq+czmq+zyre+drops stack > building on Android. > > On Mon, Jan 6, 2014 at 10:12 PM, Lindley French wrote: >> Now that I've read Chapter 8 completely, I'm quite certain I could help get >> zyre working on Android once I get hold of a phone. For one thing, I've >> already created a very similar system for Android, so many of the same >> lessons should apply. It was a bit bizarre how similar my solution to peer >> messaging was to Zyre, actuallyI found myself nodding many times >> throughout that chapter. UDP beacons for discovery, pooled TCP connections >> for peer messaging, the need for a HELLO message of sorts (although in my >> case, it went out with every new TCP connection, so port reuse wasn't an >> issue). I also sympathize entirely with the problems of setting up 30-phone >> simulations, at least until our python codebase matured to automate the >> process and we created a tool to issue ADB commands to all the phones in >> parallel. >> >> This tells me that we're both probably on the right track. >> >> The main differences were: >> 1) Mine was written in almost pure Java (one or two Android-specific things >> made it in). >> 2) I had to manage the TCP connections myself since I didn't use 0MQ. Also, >> messages flowed both ways across a single connection between peers rather >> than using multiple connections as in the Harmony pattern. >> 3) I put a lot of effort into giving senders a confirmation that their >> message had made it, or letting them know I wasn't able to confirm it, using >> a java Future and messaging ACKs. >> 4) I had a capability to supplement the beacon broadcasts with additional >> beacon unicasts to specified addresses. This turned out to be all that was >> necessary to create geographically distant "peers" under controlled >> circumstances. (I didn't address discovery of what addresses to unicast to.) >> 5) The system was created from the start to be edge-oriented rather than >> node-oriented. That is, a peer was defined both by the destination and the >> interface used to reach it. >> 6) I never attempted group messaging, although I was aware it was a >> desirable goal. >> >> >> >> On Wed, Jan 1, 2014 at 4:37 PM, Pieter Hintjens wrote: >>> >>> Lindley, would you be able to help get Zyre et all working on Android? >>> >>> On Wed, Jan 1, 2014 at 8:44 PM, Lindley French wrote: >>> > Oh---and some network functionality shuts down on Android when the >>> > device is >>> > inactive if you don't take the appropriate lock. This is a critical >>> > consideration when designing edge networking services. >>> > >>> > On Jan 1, 2014, at 1:17 PM, Lindley French wrote: >>> > >>> > On Android at least, if you have any trouble with UDP broadcast or >>> > multicast, you should trying using the IPv6 all-hosts address. Android's >>> > built-in filtering doesn't seem to affect IPv6 the same way as IPv4. >>> > >>> > >>> > On Wed, Jan 1, 2014 at 12:10 AM, Sean Robertson >>> > wrote: >>> >> >>> >> I have something like this in the works, in the form of an iOS >>> >> application >>> >> that I hope to soon port to Android. It doesn't properly use Zyre but >>> >> rather >>> >> my own haphazard reimplementation, due to some silliness with Apple's >>> >> UDP >>> >> broadcast (https://github.com/zeromq/czmq/issues/297). The UI works >>> >> decently >>> >> though. I'll send the code to this list later this week. >>> >> >>> >> On Dec 31, 2013 6:38 PM, "Lindley French" wrote: >>> >>> >>> >>> Asych twitter is a good idea and will work well. I've seen it done. >>> >>> Another fun application is async push to talk. >>> >>> >>> >>> On Dec 31, 2013, at 9:32 PM, crocket wrote: >>> >>> >>> >>> May asynchronous twitter be more appropriate for my idea? >>> >>> Asynchronous twitter, asynchronous IRC, whatever. >>> >>> >>> >>> >>> >>> On Wed, Jan 1, 2014 at 11:19 AM, crocket >>> >>> wrote: >>> >>> With asynchronous IRC software, you can choose your nickname and a >>> topic. >>> You send messages that belong to a topic. >>> People who subscribed to that topic receive your message. >>> Or they might choose to receive messages from every topic. >>> >>> This becomes very interesting when population density goes up very >>> high >>> in a small area. >>> Imagine that you went to comiket. Wikipedia says "Comiket (コミケット >>> Komiketto?), otherwise known as the Comic Mar
Re: [zeromq-dev] Race conditions again
Hi Pieter, > I've never used thread sanitizer. I highly recommend it. If you grab clang 3.3 and configure as I showed in my previous mail and run the tests, you will see *lots* of race conditions. I believe that these are real. (Clang is pretty good at not producing false positives.) Some of the races are potentially serious, such as calling free() in one thread on a pointer returned from malloc() in another thread without an intervening lock. > Two things strike me. First, if > there are *real* race conditions, you can help by tracking these down > and working with us to fix them. I can try and help, but I'm totally unfamiliar with the zmq code base, so this probably will be quite slow for me. > Secondly, if these are false > positives, there must be some "ignore" file, as we use for valgrind. Yes, there is an ignore file. Unfortunately, it doesn't offer the fine-grained control that valgrind provides. You can only specify the topmost stack frame, not a whole section of stack (as valgrind permits), so the only way to disable a race condition from a call to free() is to suppress errors for all threads calling free(), whether they are my own or zmq's. > As for race conditions in your own code, if you do not use shared > mutable state, and only pass data between threads via messages, there > is no opportunity for race conditions in your own code. There are parts of the code that do things via messages between threads, but there are other parts that do things with threads the old-fashioned way. In particular, my code is part of a library that loads modules at run time from shared libraries. The code in those shared libraries is provided by third parties and can create its own threads and do what it likes with them. So, basically, I'm not in full control of all the threads and what they do. That's why it's so important to get clean thread sanitizer output. But aside from what I would like, would you mind at least building with clang and running the tests? It might turn out to be something of an eye-opener. I'm pretty sure that most of the race conditions reported by clang in zmq are real. Cheers, Michi. ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] Race conditions again
I've never used thread sanitizer. Two things strike me. First, if there are *real* race conditions, you can help by tracking these down and working with us to fix them. Secondly, if these are false positives, there must be some "ignore" file, as we use for valgrind. As for race conditions in your own code, if you do not use shared mutable state, and only pass data between threads via messages, there is no opportunity for race conditions in your own code. -Pieter On Tue, Jan 7, 2014 at 2:24 AM, Michi Henning wrote: > Hi folks, > > I've been using zmq (3.2.3) with good success, but I'm getting a lot of noise > from > clang's thread sanitizer about race conditions. > > I've compiled both 3.2.3 and 4.0.3 with clang and thread sanitizer enabled. > Running the test suite generates hundreds of reports of race conditions. > It appears that many of these are harmless (at least, I haven't seen any > crashes). > But getting all this noise from thread sanitizer makes it very difficult to > use the > tool because any race conditions that I introduce in my own code are very hard > to spot in all the noise. (Thread sanitizer does have a suppression mechanism, > but it's quite coarse, nowhere near as fine-grained as, say, valgrind's.) > > In my experience, problems reported by thread sanitizer are generally worth > paying attention to. (There are few false positives.) > > Is there any chance of getting a zmq release that runs clean with thread > sanitizer? > > Thanks, > > Michi. > ___ > 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] Race conditions again
Oops, forgot, here are the build settings I used for zmq 4.0.3: ./configure CC=clang CCFLAGS="-fPIC -fsanitize=thread" CXX=clang++ CXXFLAGS="-fPIC -fsanitize=thread -fno-omit-frame-pointer" CFLAGS="-fPIC" LDFLAGS="-fsanitize=thread" Cheers, Michi. On 7 Jan 2014, at 11:24 , Michi Henning wrote: > Hi folks, > > I've been using zmq (3.2.3) with good success, but I'm getting a lot of noise > from > clang's thread sanitizer about race conditions. > > I've compiled both 3.2.3 and 4.0.3 with clang and thread sanitizer enabled. > Running the test suite generates hundreds of reports of race conditions. > It appears that many of these are harmless (at least, I haven't seen any > crashes). > But getting all this noise from thread sanitizer makes it very difficult to > use the > tool because any race conditions that I introduce in my own code are very hard > to spot in all the noise. (Thread sanitizer does have a suppression mechanism, > but it's quite coarse, nowhere near as fine-grained as, say, valgrind's.) > > In my experience, problems reported by thread sanitizer are generally worth > paying attention to. (There are few false positives.) > > Is there any chance of getting a zmq release that runs clean with thread > sanitizer? > > Thanks, > > Michi. > ___ > 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] Race conditions again
Hi folks, I've been using zmq (3.2.3) with good success, but I'm getting a lot of noise from clang's thread sanitizer about race conditions. I've compiled both 3.2.3 and 4.0.3 with clang and thread sanitizer enabled. Running the test suite generates hundreds of reports of race conditions. It appears that many of these are harmless (at least, I haven't seen any crashes). But getting all this noise from thread sanitizer makes it very difficult to use the tool because any race conditions that I introduce in my own code are very hard to spot in all the noise. (Thread sanitizer does have a suppression mechanism, but it's quite coarse, nowhere near as fine-grained as, say, valgrind's.) In my experience, problems reported by thread sanitizer are generally worth paying attention to. (There are few false positives.) Is there any chance of getting a zmq release that runs clean with thread sanitizer? Thanks, Michi. ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] zmq_poll() error
That would be easier if I weren't using zmqpp around it. Anyway, I'd like to better understand what signal it is. I don't have much experience with poll; I more often use select(). > On Jan 6, 2014, at 6:03 PM, Michel Pelletier > wrote: > > As the docs say: > > http://api.zeromq.org/4-1:zmq-poll > > "EINTR > The operation was interrupted by delivery of a signal before any events were > available." > > I assume if you want to ignore the signal then just looping back over > zmq_poll() again would be fine. You could also set a signal mask to ignore > whatever signal is happening. > > -Michel > > > >> On Mon, Jan 6, 2014 at 2:40 PM, Lindley French wrote: >> I'm trying to use zmq_poll() to test whether a TCP dealer or an inproc pull >> socket have anything available to read. However, sometimes I am getting an >> EINTR error. This appears to be because the poll() function is returning -1. >> However, no bits are set in revents for either descriptor, so I'm not sure >> what's going on. >> >> Any suggestions? >> >> ___ >> 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] An interesting use-case for EdgeNet : Asynchronous IRC?
Interesting. There are so many avenues for fun stuff. Right now the challenge is just to get the basic libzmq+czmq+zyre+drops stack building on Android. On Mon, Jan 6, 2014 at 10:12 PM, Lindley French wrote: > Now that I've read Chapter 8 completely, I'm quite certain I could help get > zyre working on Android once I get hold of a phone. For one thing, I've > already created a very similar system for Android, so many of the same > lessons should apply. It was a bit bizarre how similar my solution to peer > messaging was to Zyre, actuallyI found myself nodding many times > throughout that chapter. UDP beacons for discovery, pooled TCP connections > for peer messaging, the need for a HELLO message of sorts (although in my > case, it went out with every new TCP connection, so port reuse wasn't an > issue). I also sympathize entirely with the problems of setting up 30-phone > simulations, at least until our python codebase matured to automate the > process and we created a tool to issue ADB commands to all the phones in > parallel. > > This tells me that we're both probably on the right track. > > The main differences were: > 1) Mine was written in almost pure Java (one or two Android-specific things > made it in). > 2) I had to manage the TCP connections myself since I didn't use 0MQ. Also, > messages flowed both ways across a single connection between peers rather > than using multiple connections as in the Harmony pattern. > 3) I put a lot of effort into giving senders a confirmation that their > message had made it, or letting them know I wasn't able to confirm it, using > a java Future and messaging ACKs. > 4) I had a capability to supplement the beacon broadcasts with additional > beacon unicasts to specified addresses. This turned out to be all that was > necessary to create geographically distant "peers" under controlled > circumstances. (I didn't address discovery of what addresses to unicast to.) > 5) The system was created from the start to be edge-oriented rather than > node-oriented. That is, a peer was defined both by the destination and the > interface used to reach it. > 6) I never attempted group messaging, although I was aware it was a > desirable goal. > > > > On Wed, Jan 1, 2014 at 4:37 PM, Pieter Hintjens wrote: >> >> Lindley, would you be able to help get Zyre et all working on Android? >> >> On Wed, Jan 1, 2014 at 8:44 PM, Lindley French wrote: >> > Oh---and some network functionality shuts down on Android when the >> > device is >> > inactive if you don't take the appropriate lock. This is a critical >> > consideration when designing edge networking services. >> > >> > On Jan 1, 2014, at 1:17 PM, Lindley French wrote: >> > >> > On Android at least, if you have any trouble with UDP broadcast or >> > multicast, you should trying using the IPv6 all-hosts address. Android's >> > built-in filtering doesn't seem to affect IPv6 the same way as IPv4. >> > >> > >> > On Wed, Jan 1, 2014 at 12:10 AM, Sean Robertson >> > wrote: >> >> >> >> I have something like this in the works, in the form of an iOS >> >> application >> >> that I hope to soon port to Android. It doesn't properly use Zyre but >> >> rather >> >> my own haphazard reimplementation, due to some silliness with Apple's >> >> UDP >> >> broadcast (https://github.com/zeromq/czmq/issues/297). The UI works >> >> decently >> >> though. I'll send the code to this list later this week. >> >> >> >> On Dec 31, 2013 6:38 PM, "Lindley French" wrote: >> >>> >> >>> Asych twitter is a good idea and will work well. I've seen it done. >> >>> Another fun application is async push to talk. >> >>> >> >>> On Dec 31, 2013, at 9:32 PM, crocket wrote: >> >>> >> >>> May asynchronous twitter be more appropriate for my idea? >> >>> Asynchronous twitter, asynchronous IRC, whatever. >> >>> >> >>> >> >>> On Wed, Jan 1, 2014 at 11:19 AM, crocket >> >>> wrote: >> >> With asynchronous IRC software, you can choose your nickname and a >> topic. >> You send messages that belong to a topic. >> People who subscribed to that topic receive your message. >> Or they might choose to receive messages from every topic. >> >> This becomes very interesting when population density goes up very >> high >> in a small area. >> Imagine that you went to comiket. Wikipedia says "Comiket (コミケット >> Komiketto?), otherwise known as the Comic Market (コミックマーケット Komikku >> Māketto?), is the world's largest dōjinshi fair, held twice a year in >> Tokyo, >> Japan." >> >> ~590,000 people attended comiket last summer. It basically looks like >> http://en.wikipedia.org/wiki/File:Comiket77.jpg >> >> With hundreds of thousands of people in a small area, asynchronous >> IRC >> becomes fun. >> Not as fun as the near-synchronous one we have now, but still. >> >> I think asynchronous IRC may entice people to adopt EdgeNet starting >> from big meetups. >> >>> >> >>> >
Re: [zeromq-dev] zmq_poll() error
As the docs say: http://api.zeromq.org/4-1:zmq-poll "EINTR The operation was interrupted by delivery of a signal before any events were available." I assume if you want to ignore the signal then just looping back over zmq_poll() again would be fine. You could also set a signal mask to ignore whatever signal is happening. -Michel On Mon, Jan 6, 2014 at 2:40 PM, Lindley French wrote: > I'm trying to use zmq_poll() to test whether a TCP dealer or an inproc > pull socket have anything available to read. However, sometimes I am > getting an EINTR error. This appears to be because the poll() function is > returning -1. However, no bits are set in revents for either descriptor, so > I'm not sure what's going on. > > Any suggestions? > > ___ > 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] zmq_poll() error
I'm trying to use zmq_poll() to test whether a TCP dealer or an inproc pull socket have anything available to read. However, sometimes I am getting an EINTR error. This appears to be because the poll() function is returning -1. However, no bits are set in revents for either descriptor, so I'm not sure what's going on. Any suggestions? ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] An interesting use-case for EdgeNet : Asynchronous IRC?
Now that I've read Chapter 8 completely, I'm quite certain I could help get zyre working on Android once I get hold of a phone. For one thing, I've already created a very similar system for Android, so many of the same lessons should apply. It was a bit bizarre how similar my solution to peer messaging was to Zyre, actuallyI found myself nodding many times throughout that chapter. UDP beacons for discovery, pooled TCP connections for peer messaging, the need for a HELLO message of sorts (although in my case, it went out with every new TCP connection, so port reuse wasn't an issue). I also sympathize entirely with the problems of setting up 30-phone simulations, at least until our python codebase matured to automate the process and we created a tool to issue ADB commands to all the phones in parallel. This tells me that we're both probably on the right track. The main differences were: 1) Mine was written in almost pure Java (one or two Android-specific things made it in). 2) I had to manage the TCP connections myself since I didn't use 0MQ. Also, messages flowed both ways across a single connection between peers rather than using multiple connections as in the Harmony pattern. 3) I put a lot of effort into giving senders a confirmation that their message had made it, or letting them know I wasn't able to confirm it, using a java Future and messaging ACKs. 4) I had a capability to supplement the beacon broadcasts with additional beacon unicasts to specified addresses. This turned out to be all that was necessary to create geographically distant "peers" under controlled circumstances. (I didn't address discovery of what addresses to unicast to.) 5) The system was created from the start to be edge-oriented rather than node-oriented. That is, a peer was defined both by the destination and the interface used to reach it. 6) I never attempted group messaging, although I was aware it was a desirable goal. On Wed, Jan 1, 2014 at 4:37 PM, Pieter Hintjens wrote: > Lindley, would you be able to help get Zyre et all working on Android? > > On Wed, Jan 1, 2014 at 8:44 PM, Lindley French wrote: > > Oh---and some network functionality shuts down on Android when the > device is > > inactive if you don't take the appropriate lock. This is a critical > > consideration when designing edge networking services. > > > > On Jan 1, 2014, at 1:17 PM, Lindley French wrote: > > > > On Android at least, if you have any trouble with UDP broadcast or > > multicast, you should trying using the IPv6 all-hosts address. Android's > > built-in filtering doesn't seem to affect IPv6 the same way as IPv4. > > > > > > On Wed, Jan 1, 2014 at 12:10 AM, Sean Robertson > > wrote: > >> > >> I have something like this in the works, in the form of an iOS > application > >> that I hope to soon port to Android. It doesn't properly use Zyre but > rather > >> my own haphazard reimplementation, due to some silliness with Apple's > UDP > >> broadcast (https://github.com/zeromq/czmq/issues/297). The UI works > decently > >> though. I'll send the code to this list later this week. > >> > >> On Dec 31, 2013 6:38 PM, "Lindley French" wrote: > >>> > >>> Asych twitter is a good idea and will work well. I've seen it done. > >>> Another fun application is async push to talk. > >>> > >>> On Dec 31, 2013, at 9:32 PM, crocket wrote: > >>> > >>> May asynchronous twitter be more appropriate for my idea? > >>> Asynchronous twitter, asynchronous IRC, whatever. > >>> > >>> > >>> On Wed, Jan 1, 2014 at 11:19 AM, crocket > wrote: > > With asynchronous IRC software, you can choose your nickname and a > topic. > You send messages that belong to a topic. > People who subscribed to that topic receive your message. > Or they might choose to receive messages from every topic. > > This becomes very interesting when population density goes up very > high > in a small area. > Imagine that you went to comiket. Wikipedia says "Comiket (コミケット > Komiketto?), otherwise known as the Comic Market (コミックマーケット Komikku > Māketto?), is the world's largest dōjinshi fair, held twice a year in > Tokyo, > Japan." > > ~590,000 people attended comiket last summer. It basically looks like > http://en.wikipedia.org/wiki/File:Comiket77.jpg > > With hundreds of thousands of people in a small area, asynchronous IRC > becomes fun. > Not as fun as the near-synchronous one we have now, but still. > > I think asynchronous IRC may entice people to adopt EdgeNet starting > from big meetups. > >>> > >>> > >>> ___ > >>> 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] inproc bind/connect order and GET_FD/EVENTS
I saw some work being done on inproc sockets being relaxed wrt bind/connect order it seems inproc sockets still have an issue when the GET_FD/EVENTS scheme is used. inproc: connect then bind - works inproc: bind then connect - no events delivered on GET_FD fd all other variations I tried (tcp, ipc) work in any order testcase: http://static.mah.priv.at/public/zinproc.c gcc -g zinproc.c `pkg-config --cflags --libs libczmq` -o zinproc ./zinproc # inproc, connect then bind - works ./zinproc -r # inproc, bind then connect - no events delivered on GET_FD fd # these all work fine ./zinproc ipc://foo ./zinproc -r ipc://foo ./zinproc -r -u tcp://127.0.0.1:1234 ./zinproc -u tcp://127.0.0.1:1234 please advise what to do with this (file a bug? make a testcase if this is legit use? fixing might be above my paygrade;) - Michael versions: libzmq: commit ecb9770947f6eacc5ab016eb32cbd60d6b614953 Merge: c7e3efb 96f5fdd Author: Pieter Hintjens Date: Mon Jan 6 04:46:52 2014 -0800 Merge pull request #809 from hurtonm/master Simplify ypipe_t and ypipe_base_t template parameters czmq: commit 3b8686cdb06901a461f1e9ca125b25ec77ccd4b7 Merge: b5730c5 90b73ee Author: Pieter Hintjens Date: Mon Jan 6 12:24:43 2014 -0800 Merge pull request #355 from mhaberler/zloop_timer-doc-fix zloop_timer: correct documentation of return value ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] Send HTTP request and get response using ZeroMQ
On 01/05/2014 10:12 PM, Ravir Pandey wrote: > Is there any way to send http request and get response from server. > > For Ex. - i want to send request to my http server http://341.23.43.21, > after processing request i need a reply from same server. > > How can i achieve this? You can try using Zurl. It gateways REQ/REP to HTTP, using libcurl. Justin ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] ZeroMQ Java Binding install -- issues & solution
I’ve just sent a pull request to fix the broken jar file https://github.com/zeromq/jzmq/pull/277 On Jan 4, 2014, at 21:41, Bruno D. Rodrigues wrote: > I’ve just grabbed the latest version and indeed it’s weird what is happening. > > make creates a jar file inside src/main/c++/zmq.jar, which has a wrong folder > hierarchy, like you show, with a ../java. > > but if you ignore that file and run mvn clean -Dmaven.test.skip, then there > is a correct jar inside target/jzmq4-4.0.0-SNAPSHOT.jar > > The test.skip is because one of the tests if failing for me. > > I have no time right now but if no one else fixes this, I’ll try to help > tomorrow or during the week. > > > On Jan 4, 2014, at 17:51, Kiran Karra wrote: > >> Hi All, >> >> Apologies in advance if this has already been discussed before, but I >> was trying to use ZeroMQ's Java Bindings. I am running MacOSX 10.9 >> (Mavericks), as well as ZeroMQ 4.0.3, and then downloaded the java >> bindings from the github. I followed the directions: >> >> $ ./autogen.sh >> $ ./configure >> $ make >> $ make install >> >> I then tried to use the zmq.jar, but noticed that I kept getting >> import errors in Eclipse, that org.zeromq was not found. I looked at >> the jar contents w/ jar tf zmq.jar (which is located in >> /usr/local/share/java), and it showed: >> >> Kirans-MacBook-Pro:java Kiran$ jar tf zmq.jar >> META-INF/ >> META-INF/MANIFEST.MF >> ../java/org/zeromq/EmbeddedLibraryTools.class >> ../java/org/zeromq/ZContext.class >> etc etc >> I'm not a java guru, but I think the problem is that in my code, I am >> trying to import org.zeromq.ZMQ (as was given in the samples on the >> zmq website). However, the relative path specified by the jar is >> throwing things off. >> >> I regenerated the jar as follows: >> First follow all the steps to compile the java sources (i.e., autogen, >> configure, make). >> Then: >> 1.) $ cd ~/jzmq-master/src/main/java >> 2.) $ jar cf zmq-kiran.jar org/zeromq/*.class >> test it >> 3.) >> >> sh-3.2# jar tf zmq-kiran.jar >> META-INF/ >> META-INF/MANIFEST.MF >> org/zeromq/EmbeddedLibraryTools.class >> org/zeromq/ZContext.class >> org/zeromq/ZDispatcher$1.class >> The relative paths are now correct. >> >> Using this jar, the imports and the java program now works ... Not >> sure if this is a specific issue to my computer, or if it is general? >> >> >> >> Kiran >> ___ >> zeromq-dev mailing list >> zeromq-dev@lists.zeromq.org >> http://lists.zeromq.org/mailman/listinfo/zeromq-dev > signature.asc Description: Message signed with OpenPGP using GPGMail ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] Send HTTP request and get response using ZeroMQ
Hello, Then this option can be used on connect socket, the HTTP protocol has to be implemented elsewhere (it would be the same for server side). So create context, then socket, set the option (ROUTER_RAW) and connect to your HTTP server endpoint. Then you can implement HTTP protocol in your application. Lukasz 2014/1/6 Ravir Pandey > Ok but how can i achieve http request through this. Basically i want to > store messages in queues using zmq server and then i want to send it to my > http server. It looks like it binds with tcp://*:8080 first and after that > next process done. > > > On Mon, Jan 6, 2014 at 2:54 PM, Łukasz Nowak wrote: > >> Hello, >> >> This has stabilised in ZeroMQ 4.0. Please take a look for zmq_socket >> manpage ( http://api.zeromq.org/4-0:zmq-socket ), section "Native >> patterns" and option "ZMQ_STREAM". >> >> I am using it flawlessly on pyzmq binding. There is still depracated >> naming ROUTER_RAW option on socket. >> >> Regards, >> Lukasz >> >> >> 2014/1/6 Ravir Pandey >> >>> Is there any way to send http request and get response from server. >>> >>> For Ex. - i want to send request to my http server http://341.23.43.21, >>> after processing request i need a reply from same server. >>> >>> How can i achieve this? >>> >>> Ravi >>> >>> ___ >>> 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] Send HTTP request and get response using ZeroMQ
Ok but how can i achieve http request through this. Basically i want to store messages in queues using zmq server and then i want to send it to my http server. It looks like it binds with tcp://*:8080 first and after that next process done. On Mon, Jan 6, 2014 at 2:54 PM, Łukasz Nowak wrote: > Hello, > > This has stabilised in ZeroMQ 4.0. Please take a look for zmq_socket > manpage ( http://api.zeromq.org/4-0:zmq-socket ), section "Native > patterns" and option "ZMQ_STREAM". > > I am using it flawlessly on pyzmq binding. There is still depracated > naming ROUTER_RAW option on socket. > > Regards, > Lukasz > > > 2014/1/6 Ravir Pandey > >> Is there any way to send http request and get response from server. >> >> For Ex. - i want to send request to my http server http://341.23.43.21, >> after processing request i need a reply from same server. >> >> How can i achieve this? >> >> Ravi >> >> ___ >> 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] Pull Request: Allow clients to get origin of messages
I merged the pull request (by default, we approve :-). What would be useful would be a test case that shows the functionality working, and shows edge cases (even if they are not resolved yet). On Mon, Jan 6, 2014 at 10:45 AM, Stefan Radomski wrote: > Hi there, > > I just submitted a pull request that will allow client applications to > retrieve the origin of messages by exposing the TCP file descriptor per > message. You can get the FD via: > > int srcFd = zmq_msg_get(&msg, ZMQ_SRCFD); > > and then use getpeername(2) to get the origin of the message. The changes > are rather small in scope: I did have to introduce a new field (fd) in the > content field of a message and socket_base. There were quite some posts in > the past regarding this functionality and I’d like to argue that the > overhead, both in terms of runtime and memory as well as maintenance is > miniscule. > > At the moment, this will only work for sockets from TCP connections, > messages from other sources will return -1. If this pull request finds > approval, I will submit another one with updated documentation. Please > review it with some scrutiny as I am not intimately familiar with the inner > workings of zmq. > > Best regards > Stefan > > ___ > 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] Pull Request: Allow clients to get origin of messages
Hi there, I just submitted a pull request that will allow client applications to retrieve the origin of messages by exposing the TCP file descriptor per message. You can get the FD via: int srcFd = zmq_msg_get(&msg, ZMQ_SRCFD); and then use getpeername(2) to get the origin of the message. The changes are rather small in scope: I did have to introduce a new field (fd) in the content field of a message and socket_base. There were quite some posts in the past regarding this functionality and I’d like to argue that the overhead, both in terms of runtime and memory as well as maintenance is miniscule. At the moment, this will only work for sockets from TCP connections, messages from other sources will return -1. If this pull request finds approval, I will submit another one with updated documentation. Please review it with some scrutiny as I am not intimately familiar with the inner workings of zmq. Best regards Stefan ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev
Re: [zeromq-dev] Send HTTP request and get response using ZeroMQ
Hello, This has stabilised in ZeroMQ 4.0. Please take a look for zmq_socket manpage ( http://api.zeromq.org/4-0:zmq-socket ), section "Native patterns" and option "ZMQ_STREAM". I am using it flawlessly on pyzmq binding. There is still depracated naming ROUTER_RAW option on socket. Regards, Lukasz 2014/1/6 Ravir Pandey > Is there any way to send http request and get response from server. > > For Ex. - i want to send request to my http server http://341.23.43.21, > after processing request i need a reply from same server. > > How can i achieve this? > > Ravi > > ___ > 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