Re: [zeromq-dev] How do we activate and connect to WiFi hotspots in edgenets?

2014-01-09 Thread Pieter Hintjens
On Thu, Jan 9, 2014 at 8:24 AM, crocket crockabisc...@gmail.com wrote:

 Nowadays, almost every city is covered with WiFi hotspots.

 And, almost every modern building and meetup is covered well by WiFi
 hotspots.

 Most houses have a hotspot or two.

 Why don't we take advantage of existing WiFi hotspots? It would make things
 so much easier while we devise a way to connect phones directly or wait for
 802.11s.

You can, of course. There are some aspects to take into account:

* It works perfectly e.g. in the home or office where people naturally
put devices on their access point.
* Many public hotspots, especially in the US, block client-to-client traffic.
* Public hotspots are trivial to tap, if you care about anonymity.
* There really is no cost to using a smartphone as hotspot except a
little delay and some battery life, while switched on.
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] I need some advice please for StreamQ-Proxy

2014-01-09 Thread Pieter Hintjens
On Thu, Jan 9, 2014 at 7:50 AM, Laurent Alebarde l.aleba...@free.fr wrote:

 And a 4th one: have the security protocol (CURVE or PARANO) build on top of
 libzmq or czmq. They would simply use the libzmq default mechanism NULL.

That is what libcurve does.

 BTW, what are the pros/cons to have a security protocol built has a libzmq
 mechanism (as CURVE today), or built on top of libzmq ?

it's obviously far more work to make and use libcurve than to use
libzmq. It does not work in other languages except C. However you can
do proxying.

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


Re: [zeromq-dev] I need some advice please for StreamQ-Proxy

2014-01-09 Thread Laurent Alebarde

Thanks a lot Pieter (I missed your 23:44 message - sorry).


Le 09/01/2014 09:08, Pieter Hintjens a écrit :

On Thu, Jan 9, 2014 at 7:50 AM, Laurent Alebarde l.aleba...@free.fr wrote:


And a 4th one: have the security protocol (CURVE or PARANO) build on top of
libzmq or czmq. They would simply use the libzmq default mechanism NULL.

That is what libcurve does.


BTW, what are the pros/cons to have a security protocol built has a libzmq
mechanism (as CURVE today), or built on top of libzmq ?

it's obviously far more work to make and use libcurve than to use
libzmq. It does not work in other languages except C. However you can
do proxying.

-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] [zmqpp] receiving can only be done to empty messages?

2014-01-09 Thread Ben Gray
The main reason for not just using push_back was that I was unsure how
shifting the message when vectors went over capacity would effect the
zmq_msg_t structures. I've since wrapped the whole lot in a frame object
that handles it and now does just use push_back. (see
https://github.com/benjamg/zmqpp/tree/feature/prepend_pop_message_frames)

This branch also has been switched to using a deque over a vector to
support push and pop front, however this appears to result in a much less
performant binding and so I need to take another look at it.

I may branch out the previous commit and issue a pull request for that
though as it would solve your need for a new_raw_msg with a size as well.


On 8 January 2014 20:42, Lindley French lindl...@gmail.com wrote:

 A question about the implementation.

 I notice that the zmqpp::message_t class jumps through some hoops whenever
 the add() or raw_new_msg() method is called. It appears to be creating a
 new array of parts, moving all existing parts there, and then swapping them.

 What's the rationale for this design? It seems like it would require a lot
 more allocations and copies (thankfully only of pointers, not entire
 buffers) than simply doing a push_back on the vector.


 On Wed, Jan 8, 2014 at 2:01 PM, Lindley French lindl...@gmail.com wrote:

 One additional minor suggestion: In the poller class, the add() and
 remove() overloads that take simple ints should probably accept them by
 value rather than const reference. There's no performance penalty, and it
 would make the type system play a bit nicer in some cases.

 For instance, I just tried to add a Boost.Asio UDP socket's
 native_handle() to a zmqpp poller (as a standin until UDP is working in
 0MQ), and found that I couldn't do it if I was calling native_handle() from
 a const reference, but it worked fine with a non-const reference.


 On Wed, Jan 8, 2014 at 5:59 AM, Ben Gray b...@benjamg.com wrote:

 Pull request https://github.com/zeromq/zmqpp/pull/29 raised for this
 part of the issue (and the assert).


 On 7 January 2014 16:24, Lindley French lindl...@gmail.com wrote:

  In zmqpp, the socket_t::receive() method throws an exception if you
 pass it a non-empty message_t. This seems to be contradictory to the
 philosophy of zmq_recv(), which states that the message passed to it will
 be deallocated cleanly if necessary.

 Now, I know zmqpp defines a message as all parts of a multipart
 message, while libzmq defines it as just one part. So this isn't a direct
 contradiction of the API semantics. But it seems like this could be fixed
 without much effort.

 ___
 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

2014-01-09 Thread Justin Karneges
Just connect to Zurl's REQ-handling endpoint (by default, tcp port 5553) 
and send a tnetstring-formatted message. You can find a tnetstring PHP 
library here: https://github.com/phuedx/tnetstring (note, I've not tried 
this, as I'm not a PHP developer).

To make an HTTP request, send a message over the ZeroMQ socket with the 
following fields:
   id: a unique id for the request. could be a random number.
   method: the request method (e.g. GET)
   uri: the URL to request

All of the above fields are string types.

Zurl will then respond with a message containing the HTTP response.

On 01/08/2014 10:41 PM, Ravir Pandey wrote:
 I am not familiar with python :(

 Can you please explain a little bit?


 On Thu, Jan 9, 2014 at 2:02 AM, Justin Karneges jus...@affinix.com
 mailto:jus...@affinix.com wrote:

 Hi Ravir,

 You shouldn't need a PHP version of Zurl. Just run the daemon and then
 speak with it via ZeroMQ from any language. For reference, you can see
 tools/get.py which performs a GET request from Python.

 Fanout.io uses Zurl on its servers for various tasks, and we decided to
 open source the code in case others might find it useful.

 On 01/07/2014 11:33 PM, Ravir Pandey wrote:
   and one thing i want to know is what's the role of Fanout.io
 service in
   this?
  
  
   On Wed, Jan 8, 2014 at 12:45 PM, Ravir Pandey
   ravir.pan...@commusoft.co.uk
 mailto:ravir.pan...@commusoft.co.uk
 mailto:ravir.pan...@commusoft.co.uk
 mailto:ravir.pan...@commusoft.co.uk wrote:
  
   Hi Justin,
  
   I have gone through https://github.com/fanout/zurl. Sounds
 interesting.
  
   Is there any PHP version available?
  
  
   On Mon, Jan 6, 2014 at 11:33 PM, Justin Karneges
 jus...@affinix.com mailto:jus...@affinix.com
   mailto:jus...@affinix.com mailto:jus...@affinix.com wrote:
  
   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 mailto:zeromq-dev@lists.zeromq.org
 mailto:zeromq-dev@lists.zeromq.org
 mailto:zeromq-dev@lists.zeromq.org
   http://lists.zeromq.org/mailman/listinfo/zeromq-dev
  
  
  
  
  
   ___
   zeromq-dev mailing list
   zeromq-dev@lists.zeromq.org mailto:zeromq-dev@lists.zeromq.org
   http://lists.zeromq.org/mailman/listinfo/zeromq-dev
  

 ___
 zeromq-dev mailing list
 zeromq-dev@lists.zeromq.org mailto: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

2014-01-09 Thread Justin Karneges
Oh, and the message you send must be prefixed with a capital 'T' 
character. Byte 0 is a T, and byte 1 is the start of the 
tnetstring-formatted payload.

On 01/09/2014 01:26 AM, Justin Karneges wrote:
 Just connect to Zurl's REQ-handling endpoint (by default, tcp port 5553)
 and send a tnetstring-formatted message. You can find a tnetstring PHP
 library here: https://github.com/phuedx/tnetstring (note, I've not tried
 this, as I'm not a PHP developer).

 To make an HTTP request, send a message over the ZeroMQ socket with the
 following fields:
 id: a unique id for the request. could be a random number.
 method: the request method (e.g. GET)
 uri: the URL to request

 All of the above fields are string types.

 Zurl will then respond with a message containing the HTTP response.

 On 01/08/2014 10:41 PM, Ravir Pandey wrote:
 I am not familiar with python :(

 Can you please explain a little bit?


 On Thu, Jan 9, 2014 at 2:02 AM, Justin Karneges jus...@affinix.com
 mailto:jus...@affinix.com wrote:

  Hi Ravir,

  You shouldn't need a PHP version of Zurl. Just run the daemon and then
  speak with it via ZeroMQ from any language. For reference, you can see
  tools/get.py which performs a GET request from Python.

  Fanout.io uses Zurl on its servers for various tasks, and we decided to
  open source the code in case others might find it useful.

  On 01/07/2014 11:33 PM, Ravir Pandey wrote:
and one thing i want to know is what's the role of Fanout.io
  service in
this?
   
   
On Wed, Jan 8, 2014 at 12:45 PM, Ravir Pandey
ravir.pan...@commusoft.co.uk
  mailto:ravir.pan...@commusoft.co.uk
  mailto:ravir.pan...@commusoft.co.uk
  mailto:ravir.pan...@commusoft.co.uk wrote:
   
Hi Justin,
   
I have gone through https://github.com/fanout/zurl. Sounds
  interesting.
   
Is there any PHP version available?
   
   
On Mon, Jan 6, 2014 at 11:33 PM, Justin Karneges
  jus...@affinix.com mailto:jus...@affinix.com
mailto:jus...@affinix.com mailto:jus...@affinix.com wrote:
   
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 mailto:zeromq-dev@lists.zeromq.org
  mailto:zeromq-dev@lists.zeromq.org
  mailto:zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev
   
   
   
   
   
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org mailto:zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev
   

  ___
  zeromq-dev mailing list
  zeromq-dev@lists.zeromq.org mailto: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] How do we activate and connect to WiFi hotspots in edgenets?

2014-01-09 Thread Bjorn Reese
On 01/09/2014 09:06 AM, Pieter Hintjens wrote:

 * Many public hotspots, especially in the US, block client-to-client traffic.

If you are talking about wireless isolation, then they only block
multicasting. This means that you cannot discover other devices, but
if you happen to know their IP than you can communcate with them.

Some systems provide a fall-back solution that will do device discovery
via a cloud server. Qualcomm's AllJoyn/AllSeen is an example of that.
Not very EdgeNetish though.

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


Re: [zeromq-dev] How do we activate and connect to WiFi hotspots in edgenets?

2014-01-09 Thread Bruno D. Rodrigues
On Jan 9, 2014, at 10:52, Bjorn Reese bre...@mail1.stofanet.dk wrote:

 On 01/09/2014 09:06 AM, Pieter Hintjens wrote:
 
 * Many public hotspots, especially in the US, block client-to-client traffic.
 
 If you are talking about wireless isolation, then they only block
 multicasting. This means that you cannot discover other devices, but
 if you happen to know their IP than you can communcate with them.


I think Pieter was quite clear with his sentence, and explains with much more 
detail on the book.

I’ll add that in Europe it’s also typical to block client-to-client on the 
mobile network, including traffic initiated from the internet into the public 
IP of the mobile or data card.



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] How do we activate and connect to WiFi hotspots in edgenets?

2014-01-09 Thread Pieter Hintjens
On Thu, Jan 9, 2014 at 12:19 PM, Bruno D. Rodrigues
bruno.rodrig...@litux.org wrote:
 On Jan 9, 2014, at 10:52, Bjorn Reese bre...@mail1.stofanet.dk wrote:

 If you are talking about wireless isolation, then they only block
 multicasting. This means that you cannot discover other devices, but
 if you happen to know their IP than you can communcate with them.

 I think Pieter was quite clear with his sentence, and explains with much more 
 detail on the book.

From testing, it varies. On some hotspots, UDP broadcast and/or
multicast is blocked. On other hotspots, client to client access is
blocked, even if you know the IP address. One test case is bulk
connecting, i.e. issue zmq_connect () to every other IP address on the
block. That fails on perhaps 20-50% of hotspots, even in offices.

It's a bit of a mess. Since we're not in control of the hardware we
cannot be very ambitious. Hence my preference for the smartphone
hotspot.

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


Re: [zeromq-dev] I need some advice please for StreamQ-Proxy

2014-01-09 Thread Pieter Hintjens
No problem. The project you want is here: https://github.com/zeromq/libcurve



On Thu, Jan 9, 2014 at 9:27 AM, Laurent Alebarde l.aleba...@free.fr wrote:
 Thanks a lot Pieter (I missed your 23:44 message - sorry).


 Le 09/01/2014 09:08, Pieter Hintjens a écrit :

 On Thu, Jan 9, 2014 at 7:50 AM, Laurent Alebarde l.aleba...@free.fr wrote:

 And a 4th one: have the security protocol (CURVE or PARANO) build on top of
 libzmq or czmq. They would simply use the libzmq default mechanism NULL.

 That is what libcurve does.

 BTW, what are the pros/cons to have a security protocol built has a libzmq
 mechanism (as CURVE today), or built on top of libzmq ?

 it's obviously far more work to make and use libcurve than to use
 libzmq. It does not work in other languages except C. However you can
 do proxying.

 -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


[zeromq-dev] Majordomo C example slow

2014-01-09 Thread sridhar parasuraman
I am a new user. I just compiled the c Majordomo example and run it in my
development laptop. It ran successfully but was extremely slow.
~/gitzguide/zguide/examples/C$ time ./mdclient
10 requests/replies processed

real1m8.093s
user0m8.224s
sys0m8.872s

Has anyone experienced this issue before? Am I doing something seriously
wrong?


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


Re: [zeromq-dev] How do we activate and connect to WiFi hotspots in edgenets?

2014-01-09 Thread crocket
Can manual assistance be effective in case of anonymous/pseudonomous
broadcast used in async message apps?
On Jan 9, 2014 3:05 PM, Pieter Hintjens p...@imatix.com wrote:

 On Thu, Jan 9, 2014 at 1:32 AM, crocket crockabisc...@gmail.com wrote:

  Until there comes the edgenet mailing list, we can talk about it here.

 Sure.

  By manual assistance, do you mean people turn on hotspots and connect to
  them manually on site?

 Ideally, from within applications, e.g. inviting someone into your
 document would switch on a hotspot and display a PIN. Other people
 could then Search for invitations (scan for matching SSIDs) and
 enter the PIN to join.



 
  Is there any better manual method than I described above?
 
  On Jan 9, 2014 8:28 AM, Pieter Hintjens p...@imatix.com wrote:
 
  (a) I think we need to start an edgenet mailing list, as this is both
  such an interesting discussion, and yet so different from what people
  are expecting here
 
  (b) wifidirect is a not quite mesh 1-to-1 link and in fact very
  close to what I was thinking of with edgenet in the beginning. There's
  not a lot of choice, if you don't have 802.11s mesh working in the
  firmware, which few devices have.
 
  (c) you don't need root access to enable AP mode on most phones afaik.
  Not Android, anyhow (the API isn't documented but you can dig it out.)
 
  (d) we tried, and failed (in a previous closed project) to create and
  discover cells automatically. Best approach seems to be manual
  assistance.
 
  -Pieter
 
  On Wed, Jan 8, 2014 at 4:58 PM, Arnaud Loonstra arn...@sphaero.org
  wrote:
   On 01/08/2014 03:46 PM, Bruno D. Rodrigues wrote:
   I don’t know too many details about FON, but we have an ISP in
 Portugal
   that provides FON over all their clients (if they accept) and as soon
   as
   I connect to one FON hotstpot, the device automatically connects to
 any
   other. No idea if it’s just because it’s the same name, or if there
 is
   any other value that is forced to be the same, but somehow it is
   possible.
  
   On Jan 8, 2014, at 12:03, crocket crockabisc...@gmail.com
   mailto:crockabisc...@gmail.com wrote:
  
   People may be able to devise an algorithm for automatically turning
 on
   hotspots in several smartphones among many.
  
   But, even with hotspots turned on, how do phones connect to each
 other
   if smartphones simply refuse to connect to randomly named hotspots?
  
   Should we forcefully rename hotspots to a predetermined name(e.g.,
   edgenet) and agree to connect to hotspots named edgenet?
  
  
   You could follow a roaming setup. Setup an hotspot with any name and
   make sure it is setup for roaming. Usually the authentication is done
   using radius. Which would be very easy to implement as radius is very
   simple protocol. Even just MAC authentication would suffice but you
   could go on into EAP/TTLS or PEAP setups.
  
   To setup an hotspot on a phone you'll probably need root access.
  
   WifiDirect would be better but I don't any devices that support it. It
   will probably be stopped by vendors ;) Just like PTT.
  
   Rg,
  
   Arnaud
  
   --
   w: http://www.sphaero.org
   t: http://twitter.com/sphaero
   g: http://github.com/sphaero
   i: freenode: sphaero_z25
   ___
   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] How many OS threads does ZeroMQ use internally?

2014-01-09 Thread Jan Drabner
Hey there,

We are currently doing research for our project to figure out the best 
way to do inter-thread communication with a message queue. As we are 
using zmq for networking purposes already, it was logical to also 
research it for the above purpose.

Now, we will have a number of threads (say 5-10) communicating with each 
other to send commands, synchronize data, etc.
Each of the threads will have to communicate with a certain number of 
other threads. I figured that for this setup, making each thread a 
publisher as well as a subscriber to the other threads it wants to 
listen to would be the best bet.
However, I do not know how many internal zmq threads that would yield.

Imagine this socket situation for thread A (all threads use the same 
context, only inproc is used):
Socket for publishing
Socket for subscribing to thread B
Socket for subscribing to thread F
Socket for subscribing to thread J

How many internal zmq OS threads would be spawned for this?

If it is just one (per context), it would be fine. If it is one 
additional internal thread per our thread (or per publishing socket), it 
would probably be acceptable. If it was per socket (any kind of socket), 
however, that would be really bad as it would mean we had roughly +5 
threads per our own thread. Even if those thread do not do much, they 
would still take away too many pieces of the cake.

Hope someone can answer that question :)
Regards,
Jan


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


Re: [zeromq-dev] How do we activate and connect to WiFi hotspots in edgenets?

2014-01-09 Thread Pieter Hintjens
My idea was to make it like a game: by finding and peering with other
devices you gain points. It is very close to deliberate peering with
people you actually know. The two cases may overlap.

On Thu, Jan 9, 2014 at 2:13 PM, crocket crockabisc...@gmail.com wrote:
 Can manual assistance be effective in case of anonymous/pseudonomous
 broadcast used in async message apps?

 On Jan 9, 2014 3:05 PM, Pieter Hintjens p...@imatix.com wrote:

 On Thu, Jan 9, 2014 at 1:32 AM, crocket crockabisc...@gmail.com wrote:

  Until there comes the edgenet mailing list, we can talk about it here.

 Sure.

  By manual assistance, do you mean people turn on hotspots and connect to
  them manually on site?

 Ideally, from within applications, e.g. inviting someone into your
 document would switch on a hotspot and display a PIN. Other people
 could then Search for invitations (scan for matching SSIDs) and
 enter the PIN to join.



 
  Is there any better manual method than I described above?
 
  On Jan 9, 2014 8:28 AM, Pieter Hintjens p...@imatix.com wrote:
 
  (a) I think we need to start an edgenet mailing list, as this is both
  such an interesting discussion, and yet so different from what people
  are expecting here
 
  (b) wifidirect is a not quite mesh 1-to-1 link and in fact very
  close to what I was thinking of with edgenet in the beginning. There's
  not a lot of choice, if you don't have 802.11s mesh working in the
  firmware, which few devices have.
 
  (c) you don't need root access to enable AP mode on most phones afaik.
  Not Android, anyhow (the API isn't documented but you can dig it out.)
 
  (d) we tried, and failed (in a previous closed project) to create and
  discover cells automatically. Best approach seems to be manual
  assistance.
 
  -Pieter
 
  On Wed, Jan 8, 2014 at 4:58 PM, Arnaud Loonstra arn...@sphaero.org
  wrote:
   On 01/08/2014 03:46 PM, Bruno D. Rodrigues wrote:
   I don’t know too many details about FON, but we have an ISP in
   Portugal
   that provides FON over all their clients (if they accept) and as
   soon
   as
   I connect to one FON hotstpot, the device automatically connects to
   any
   other. No idea if it’s just because it’s the same name, or if there
   is
   any other value that is forced to be the same, but somehow it is
   possible.
  
   On Jan 8, 2014, at 12:03, crocket crockabisc...@gmail.com
   mailto:crockabisc...@gmail.com wrote:
  
   People may be able to devise an algorithm for automatically turning
   on
   hotspots in several smartphones among many.
  
   But, even with hotspots turned on, how do phones connect to each
   other
   if smartphones simply refuse to connect to randomly named hotspots?
  
   Should we forcefully rename hotspots to a predetermined name(e.g.,
   edgenet) and agree to connect to hotspots named edgenet?
  
  
   You could follow a roaming setup. Setup an hotspot with any name and
   make sure it is setup for roaming. Usually the authentication is done
   using radius. Which would be very easy to implement as radius is very
   simple protocol. Even just MAC authentication would suffice but you
   could go on into EAP/TTLS or PEAP setups.
  
   To setup an hotspot on a phone you'll probably need root access.
  
   WifiDirect would be better but I don't any devices that support it.
   It
   will probably be stopped by vendors ;) Just like PTT.
  
   Rg,
  
   Arnaud
  
   --
   w: http://www.sphaero.org
   t: http://twitter.com/sphaero
   g: http://github.com/sphaero
   i: freenode: sphaero_z25
   ___
   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] How many OS threads does ZeroMQ use internally?

2014-01-09 Thread Bruno D. Rodrigues
The documentation recommends creating one single context per process,
and when creating it you specify how many zeromq threads to use.



--
Bruno Rodrigues
Sent from my iPhone

No dia 09/01/2014, às 13:33, Jan Drabner j...@jdrabner.eu escreveu:

 Hey there,

 We are currently doing research for our project to figure out the best
 way to do inter-thread communication with a message queue. As we are
 using zmq for networking purposes already, it was logical to also
 research it for the above purpose.

 Now, we will have a number of threads (say 5-10) communicating with each
 other to send commands, synchronize data, etc.
 Each of the threads will have to communicate with a certain number of
 other threads. I figured that for this setup, making each thread a
 publisher as well as a subscriber to the other threads it wants to
 listen to would be the best bet.
 However, I do not know how many internal zmq threads that would yield.

 Imagine this socket situation for thread A (all threads use the same
 context, only inproc is used):
 Socket for publishing
 Socket for subscribing to thread B
 Socket for subscribing to thread F
 Socket for subscribing to thread J

 How many internal zmq OS threads would be spawned for this?

 If it is just one (per context), it would be fine. If it is one
 additional internal thread per our thread (or per publishing socket), it
 would probably be acceptable. If it was per socket (any kind of socket),
 however, that would be really bad as it would mean we had roughly +5
 threads per our own thread. Even if those thread do not do much, they
 would still take away too many pieces of the cake.

 Hope someone can answer that question :)
 Regards,
 Jan


 ___
 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] How do we activate and connect to WiFi hotspots in edgenets?

2014-01-09 Thread Lindley French
Bluetooth works well enough as a standard network interface bnep0 if the
messages you're sending are small. (It really is pretty slow, though.) The
hard part is programmatically configuring the stack to use it that way, and
(preferably) programmatically pairing without user interaction.


On Thu, Jan 9, 2014 at 1:02 AM, Pieter Hintjens p...@imatix.com wrote:

 Bluetooth is not designed for general app-to-app messaging, rather as
 a wireless connector for low-rate devices. You can plausibly use it to
 set up WiFi connections, a hybrid solution. AllJoyn is made by
 Qualcomm, who have the expertise to make BlueTooth work. For most
 people it's not practical.

 The ideal would be 802.11s mesh (as used in the OLPC), which no-one
 seems to want to build into consumer mobile devices.

 My assumption is that useful apps running on WiFi can push the market
 towards better connectivity.

 On Thu, Jan 9, 2014 at 1:31 AM, Lindley French lindl...@gmail.com wrote:
  Wifi isn't the only answer here. Bluetooth can provide similar
 functionality. I don't know the details but the Alljoyn people claim to be
 able to automatically set up Bluetooth links with phones in range.
 
  On Jan 8, 2014, at 6:27 PM, Pieter Hintjens p...@imatix.com wrote:
 
  (a) I think we need to start an edgenet mailing list, as this is both
  such an interesting discussion, and yet so different from what people
  are expecting here
 
  (b) wifidirect is a not quite mesh 1-to-1 link and in fact very
  close to what I was thinking of with edgenet in the beginning. There's
  not a lot of choice, if you don't have 802.11s mesh working in the
  firmware, which few devices have.
 
  (c) you don't need root access to enable AP mode on most phones afaik.
  Not Android, anyhow (the API isn't documented but you can dig it out.)
 
  (d) we tried, and failed (in a previous closed project) to create and
  discover cells automatically. Best approach seems to be manual
  assistance.
 
  -Pieter
 
  On Wed, Jan 8, 2014 at 4:58 PM, Arnaud Loonstra arn...@sphaero.org
 wrote:
  On 01/08/2014 03:46 PM, Bruno D. Rodrigues wrote:
  I don’t know too many details about FON, but we have an ISP in
 Portugal
  that provides FON over all their clients (if they accept) and as soon
 as
  I connect to one FON hotstpot, the device automatically connects to
 any
  other. No idea if it’s just because it’s the same name, or if there is
  any other value that is forced to be the same, but somehow it is
 possible.
 
  On Jan 8, 2014, at 12:03, crocket crockabisc...@gmail.com
  mailto:crockabisc...@gmail.com wrote:
 
  People may be able to devise an algorithm for automatically turning
 on
  hotspots in several smartphones among many.
 
  But, even with hotspots turned on, how do phones connect to each
 other
  if smartphones simply refuse to connect to randomly named hotspots?
 
  Should we forcefully rename hotspots to a predetermined name(e.g.,
  edgenet) and agree to connect to hotspots named edgenet?
 
  You could follow a roaming setup. Setup an hotspot with any name and
  make sure it is setup for roaming. Usually the authentication is done
  using radius. Which would be very easy to implement as radius is very
  simple protocol. Even just MAC authentication would suffice but you
  could go on into EAP/TTLS or PEAP setups.
 
  To setup an hotspot on a phone you'll probably need root access.
 
  WifiDirect would be better but I don't any devices that support it. It
  will probably be stopped by vendors ;) Just like PTT.
 
  Rg,
 
  Arnaud
 
  --
  w: http://www.sphaero.org
  t: http://twitter.com/sphaero
  g: http://github.com/sphaero
  i: freenode: sphaero_z25
  ___
  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] How do we activate and connect to WiFi hotspots in edgenets?

2014-01-09 Thread Lindley French
There really is no cost to using a smartphone as hotspot except a
little delay and some battery life, while switched on.

Battery life may be more of an issue than you realize. Wifi radios use far
less power than 3G radios, but they still *do* use power, and the pattern
of network activity can have a strong effect on battery life. The most
important thing to realize is that people expect their smartphones not to
use much power while they're idle. If you're doing network activity all the
time in the background, that isn't the case, and people will become unhappy
with your software and uninstall it. (Note the reactions to the first
release of Google Now, which committed a similar sin with location
services. GPS receivers use a lot of power too.)

To some extent you can be smart enough to reduce network activity
significantly while the phone is idle compared to active. Beacon less
often, include a parameter in the beacon letting other phones know you'll
only be listening for a short window after a beacon, etc. It's possible
to give the radio a break.

My concern is that once a phone is trying to host an access point, it gets
a lot harder to be selective about when the wifi radio is active. It has to
be on pretty much all the time. The exception might be ad-hoc mode-once
one node creates an ad-hoc network (which is surprisingly tricky on
Android), others can sustain the SSID without it. However, if the anchoring
node was providing DHCP services, then obviously that won't work anymore
once it goes offline.


On Thu, Jan 9, 2014 at 3:06 AM, Pieter Hintjens p...@imatix.com wrote:

 On Thu, Jan 9, 2014 at 8:24 AM, crocket crockabisc...@gmail.com wrote:

  Nowadays, almost every city is covered with WiFi hotspots.
 
  And, almost every modern building and meetup is covered well by WiFi
  hotspots.
 
  Most houses have a hotspot or two.
 
  Why don't we take advantage of existing WiFi hotspots? It would make
 things
  so much easier while we devise a way to connect phones directly or wait
 for
  802.11s.

 You can, of course. There are some aspects to take into account:

 * It works perfectly e.g. in the home or office where people naturally
 put devices on their access point.
 * Many public hotspots, especially in the US, block client-to-client
 traffic.
 * Public hotspots are trivial to tap, if you care about anonymity.
 * There really is no cost to using a smartphone as hotspot except a
 little delay and some battery life, while switched on.
 ___
 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] How many OS threads does ZeroMQ use internally?

2014-01-09 Thread Pieter Hintjens
For inproc you don't need any I/O threads at all. The default will be
1 additional thread per context, so as Bruno says, per process.

On Thu, Jan 9, 2014 at 2:33 PM, Jan Drabner j...@jdrabner.eu wrote:
 Hey there,

 We are currently doing research for our project to figure out the best
 way to do inter-thread communication with a message queue. As we are
 using zmq for networking purposes already, it was logical to also
 research it for the above purpose.

 Now, we will have a number of threads (say 5-10) communicating with each
 other to send commands, synchronize data, etc.
 Each of the threads will have to communicate with a certain number of
 other threads. I figured that for this setup, making each thread a
 publisher as well as a subscriber to the other threads it wants to
 listen to would be the best bet.
 However, I do not know how many internal zmq threads that would yield.

 Imagine this socket situation for thread A (all threads use the same
 context, only inproc is used):
 Socket for publishing
 Socket for subscribing to thread B
 Socket for subscribing to thread F
 Socket for subscribing to thread J

 How many internal zmq OS threads would be spawned for this?

 If it is just one (per context), it would be fine. If it is one
 additional internal thread per our thread (or per publishing socket), it
 would probably be acceptable. If it was per socket (any kind of socket),
 however, that would be really bad as it would mean we had roughly +5
 threads per our own thread. Even if those thread do not do much, they
 would still take away too many pieces of the cake.

 Hope someone can answer that question :)
 Regards,
 Jan


 ___
 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] How do we activate and connect to WiFi hotspots in edgenets?

2014-01-09 Thread Pieter Hintjens
Ad-hoc mode is too poorly supported to depend on. And it's slow.

In any case a phone cannot act as a hotspot for any length of time. On
some firmwares enabling AP mode will switch off 3G. This is still fine
for us. My idea was to put this decision at the user level, initially.
The application chooses to host or to join some activity. It's a
natural pattern in a group of people. The host of a meeting is less
likely to walk out the door, and more likely to have power.

On Thu, Jan 9, 2014 at 3:14 PM, Lindley French lindl...@gmail.com wrote:
There really is no cost to using a smartphone as hotspot except a
little delay and some battery life, while switched on.

 Battery life may be more of an issue than you realize. Wifi radios use far
 less power than 3G radios, but they still *do* use power, and the pattern of
 network activity can have a strong effect on battery life. The most
 important thing to realize is that people expect their smartphones not to
 use much power while they're idle. If you're doing network activity all the
 time in the background, that isn't the case, and people will become unhappy
 with your software and uninstall it. (Note the reactions to the first
 release of Google Now, which committed a similar sin with location services.
 GPS receivers use a lot of power too.)

 To some extent you can be smart enough to reduce network activity
 significantly while the phone is idle compared to active. Beacon less often,
 include a parameter in the beacon letting other phones know you'll only be
 listening for a short window after a beacon, etc. It's possible to give
 the radio a break.

 My concern is that once a phone is trying to host an access point, it gets a
 lot harder to be selective about when the wifi radio is active. It has to be
 on pretty much all the time. The exception might be ad-hoc mode-once one
 node creates an ad-hoc network (which is surprisingly tricky on Android),
 others can sustain the SSID without it. However, if the anchoring node was
 providing DHCP services, then obviously that won't work anymore once it goes
 offline.


 On Thu, Jan 9, 2014 at 3:06 AM, Pieter Hintjens p...@imatix.com wrote:

 On Thu, Jan 9, 2014 at 8:24 AM, crocket crockabisc...@gmail.com wrote:

  Nowadays, almost every city is covered with WiFi hotspots.
 
  And, almost every modern building and meetup is covered well by WiFi
  hotspots.
 
  Most houses have a hotspot or two.
 
  Why don't we take advantage of existing WiFi hotspots? It would make
  things
  so much easier while we devise a way to connect phones directly or wait
  for
  802.11s.

 You can, of course. There are some aspects to take into account:

 * It works perfectly e.g. in the home or office where people naturally
 put devices on their access point.
 * Many public hotspots, especially in the US, block client-to-client
 traffic.
 * Public hotspots are trivial to tap, if you care about anonymity.
 * There really is no cost to using a smartphone as hotspot except a
 little delay and some battery life, while switched on.
 ___
 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] Router socket to force peer disconnect

2014-01-09 Thread Pieter Hintjens
If you don't trust your peers you should probably be using ZeroMQ 4.x
and security. Then you will only see authenticated peers.

On Wed, Jan 8, 2014 at 12:32 PM, Dmitriy Vsekhvalnov
dvsekhval...@gmail.com wrote:
 Hi All,

 continue my little evaluation of zeromq and wanted to ask next question: is
 it possible to force disconnect of client from router side? (e.g. disconnect
 req or dealer).

 If it is not possible are those clients who connected to router socket
 consume resources? A lot? Even if no messages send/received from them?

 We are in environment where we don't trust peers until they complete
 handshake with router socket.
 And would like to disconnect them if handshake failed. (i know we can simply
 ignore them and keep connected).

 Thanks.

 ___
 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] How do we activate and connect to WiFi hotspots in edgenets?

2014-01-09 Thread Apostolis Xekoukoulotakis
Having no experience on the matter, why not use bluetooth as an interface
that searches for peers and wifi for real network traffic.
Wifi will be switched on only when there is need for data to be sent.
That could also help the wifi automatically switch to the best access point.

Bluetooth has a range of 50m. That is good enough for peer discovery and
peer coordination.
From the wikipedia, both of them are available on smartphones.
http://en.wikipedia.org/wiki/Bluetooth_low_energy



2014/1/9 Pieter Hintjens p...@imatix.com

 Ad-hoc mode is too poorly supported to depend on. And it's slow.

 In any case a phone cannot act as a hotspot for any length of time. On
 some firmwares enabling AP mode will switch off 3G. This is still fine
 for us. My idea was to put this decision at the user level, initially.
 The application chooses to host or to join some activity. It's a
 natural pattern in a group of people. The host of a meeting is less
 likely to walk out the door, and more likely to have power.

 On Thu, Jan 9, 2014 at 3:14 PM, Lindley French lindl...@gmail.com wrote:
 There really is no cost to using a smartphone as hotspot except a
 little delay and some battery life, while switched on.
 
  Battery life may be more of an issue than you realize. Wifi radios use
 far
  less power than 3G radios, but they still *do* use power, and the
 pattern of
  network activity can have a strong effect on battery life. The most
  important thing to realize is that people expect their smartphones not
 to
  use much power while they're idle. If you're doing network activity all
 the
  time in the background, that isn't the case, and people will become
 unhappy
  with your software and uninstall it. (Note the reactions to the first
  release of Google Now, which committed a similar sin with location
 services.
  GPS receivers use a lot of power too.)
 
  To some extent you can be smart enough to reduce network activity
  significantly while the phone is idle compared to active. Beacon less
 often,
  include a parameter in the beacon letting other phones know you'll only
 be
  listening for a short window after a beacon, etc. It's possible to give
  the radio a break.
 
  My concern is that once a phone is trying to host an access point, it
 gets a
  lot harder to be selective about when the wifi radio is active. It has
 to be
  on pretty much all the time. The exception might be ad-hoc mode-once
 one
  node creates an ad-hoc network (which is surprisingly tricky on Android),
  others can sustain the SSID without it. However, if the anchoring node
 was
  providing DHCP services, then obviously that won't work anymore once it
 goes
  offline.
 
 
  On Thu, Jan 9, 2014 at 3:06 AM, Pieter Hintjens p...@imatix.com wrote:
 
  On Thu, Jan 9, 2014 at 8:24 AM, crocket crockabisc...@gmail.com
 wrote:
 
   Nowadays, almost every city is covered with WiFi hotspots.
  
   And, almost every modern building and meetup is covered well by WiFi
   hotspots.
  
   Most houses have a hotspot or two.
  
   Why don't we take advantage of existing WiFi hotspots? It would make
   things
   so much easier while we devise a way to connect phones directly or
 wait
   for
   802.11s.
 
  You can, of course. There are some aspects to take into account:
 
  * It works perfectly e.g. in the home or office where people naturally
  put devices on their access point.
  * Many public hotspots, especially in the US, block client-to-client
  traffic.
  * Public hotspots are trivial to tap, if you care about anonymity.
  * There really is no cost to using a smartphone as hotspot except a
  little delay and some battery life, while switched on.
  ___
  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




-- 


Sincerely yours,

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


Re: [zeromq-dev] [zmqpp] receiving can only be done to empty messages?

2014-01-09 Thread Lindley French
I imagine you've figured it out by now, but just in case

When a vector method needs to reallocate the underlying array, existing
elements are move-constructed onto the new memory. If no move constructor
is defined or if you are not using C++11 mode, they will be
copy-constructed instead. (Placement new is used.) Then the objects in the
original memory will be destructed. This usually provides the expected
behavior for both C and C++ types.

My one concern is that the vector class does contain some optimizations to
allow it to use memcpy() if the contained type is plain-old-data. This is
usually detected correctly, but since zmq.h does some trickery to make the
zmq_msg_t type opaque, I can't be certain the right thing will happen
without more study.

Your solution in the above thread of defining a frame move constructor that
calls zmq_msg_move() should be safe enough.

 This branch also has been switched to using a deque over a vector to
support push and pop front, however this appears  to result in a much less
performant binding and so I need to take another look at it.

Strange. A deque will be slower than a vector in some cases, but it should
be a small constant multiplier. If you figure out what's going on I'd be
curious to know what it is.

Pragmatically speaking, a vector should usually be fine even if you want to
support a push/pop_front capabilityzmq messages will rarely have *that*
many parts, and your current master branch shows that zmq_msg_move()ing all
of them when a part is added isn't unacceptably slow anyway.

Another way of looking at the situation is that it's pretty rare for people
to access message parts in other than linear order, so something like a
std::list could be made to work relatively well. The worst-case promises
would be a little odd though.


On Thu, Jan 9, 2014 at 4:22 AM, Ben Gray b...@benjamg.com wrote:

 The main reason for not just using push_back was that I was unsure how
 shifting the message when vectors went over capacity would effect the
 zmq_msg_t structures. I've since wrapped the whole lot in a frame object
 that handles it and now does just use push_back. (see
 https://github.com/benjamg/zmqpp/tree/feature/prepend_pop_message_frames)

 This branch also has been switched to using a deque over a vector to
 support push and pop front, however this appears to result in a much less
 performant binding and so I need to take another look at it.

 I may branch out the previous commit and issue a pull request for that
 though as it would solve your need for a new_raw_msg with a size as well.


 On 8 January 2014 20:42, Lindley French lindl...@gmail.com wrote:

 A question about the implementation.

 I notice that the zmqpp::message_t class jumps through some hoops
 whenever the add() or raw_new_msg() method is called. It appears to be
 creating a new array of parts, moving all existing parts there, and then
 swapping them.

 What's the rationale for this design? It seems like it would require a
 lot more allocations and copies (thankfully only of pointers, not entire
 buffers) than simply doing a push_back on the vector.


 On Wed, Jan 8, 2014 at 2:01 PM, Lindley French lindl...@gmail.comwrote:

 One additional minor suggestion: In the poller class, the add() and
 remove() overloads that take simple ints should probably accept them by
 value rather than const reference. There's no performance penalty, and it
 would make the type system play a bit nicer in some cases.

 For instance, I just tried to add a Boost.Asio UDP socket's
 native_handle() to a zmqpp poller (as a standin until UDP is working in
 0MQ), and found that I couldn't do it if I was calling native_handle() from
 a const reference, but it worked fine with a non-const reference.


 On Wed, Jan 8, 2014 at 5:59 AM, Ben Gray b...@benjamg.com wrote:

 Pull request https://github.com/zeromq/zmqpp/pull/29 raised for this
 part of the issue (and the assert).


 On 7 January 2014 16:24, Lindley French lindl...@gmail.com wrote:

  In zmqpp, the socket_t::receive() method throws an exception if you
 pass it a non-empty message_t. This seems to be contradictory to the
 philosophy of zmq_recv(), which states that the message passed to it will
 be deallocated cleanly if necessary.

 Now, I know zmqpp defines a message as all parts of a multipart
 message, while libzmq defines it as just one part. So this isn't a direct
 contradiction of the API semantics. But it seems like this could be fixed
 without much effort.

 ___
 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] How do we activate and connect to WiFi hotspots in edgenets?

2014-01-09 Thread Lindley French
In the short term that may be the only solution that's workable without
root access on at least some of the phones. I think the full benefits of
EdgeNet won't be realized until arbitrary phones can serve as routers or
data mules without the user knowing or caring, though.

I still think WiFi Direct has a place in the solution, when it's available.
According to Wikipedia, only one phone of a group has to support WiFi
Direct for the entire group to use it.


On Thu, Jan 9, 2014 at 9:19 AM, Pieter Hintjens p...@imatix.com wrote:

 Ad-hoc mode is too poorly supported to depend on. And it's slow.

 In any case a phone cannot act as a hotspot for any length of time. On
 some firmwares enabling AP mode will switch off 3G. This is still fine
 for us. My idea was to put this decision at the user level, initially.
 The application chooses to host or to join some activity. It's a
 natural pattern in a group of people. The host of a meeting is less
 likely to walk out the door, and more likely to have power.

 On Thu, Jan 9, 2014 at 3:14 PM, Lindley French lindl...@gmail.com wrote:
 There really is no cost to using a smartphone as hotspot except a
 little delay and some battery life, while switched on.
 
  Battery life may be more of an issue than you realize. Wifi radios use
 far
  less power than 3G radios, but they still *do* use power, and the
 pattern of
  network activity can have a strong effect on battery life. The most
  important thing to realize is that people expect their smartphones not
 to
  use much power while they're idle. If you're doing network activity all
 the
  time in the background, that isn't the case, and people will become
 unhappy
  with your software and uninstall it. (Note the reactions to the first
  release of Google Now, which committed a similar sin with location
 services.
  GPS receivers use a lot of power too.)
 
  To some extent you can be smart enough to reduce network activity
  significantly while the phone is idle compared to active. Beacon less
 often,
  include a parameter in the beacon letting other phones know you'll only
 be
  listening for a short window after a beacon, etc. It's possible to give
  the radio a break.
 
  My concern is that once a phone is trying to host an access point, it
 gets a
  lot harder to be selective about when the wifi radio is active. It has
 to be
  on pretty much all the time. The exception might be ad-hoc mode-once
 one
  node creates an ad-hoc network (which is surprisingly tricky on Android),
  others can sustain the SSID without it. However, if the anchoring node
 was
  providing DHCP services, then obviously that won't work anymore once it
 goes
  offline.
 
 
  On Thu, Jan 9, 2014 at 3:06 AM, Pieter Hintjens p...@imatix.com wrote:
 
  On Thu, Jan 9, 2014 at 8:24 AM, crocket crockabisc...@gmail.com
 wrote:
 
   Nowadays, almost every city is covered with WiFi hotspots.
  
   And, almost every modern building and meetup is covered well by WiFi
   hotspots.
  
   Most houses have a hotspot or two.
  
   Why don't we take advantage of existing WiFi hotspots? It would make
   things
   so much easier while we devise a way to connect phones directly or
 wait
   for
   802.11s.
 
  You can, of course. There are some aspects to take into account:
 
  * It works perfectly e.g. in the home or office where people naturally
  put devices on their access point.
  * Many public hotspots, especially in the US, block client-to-client
  traffic.
  * Public hotspots are trivial to tap, if you care about anonymity.
  * There really is no cost to using a smartphone as hotspot except a
  little delay and some battery life, while switched on.
  ___
  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] Router socket to force peer disconnect

2014-01-09 Thread Dmitriy Vsekhvalnov
I'd like to. But it doesn't seem to be possible with Java or CLR at the
moment. And we don't have time/budget to invest in support right now.

Thanks for answer.


On Thu, Jan 9, 2014 at 6:19 PM, Pieter Hintjens p...@imatix.com wrote:

 If you don't trust your peers you should probably be using ZeroMQ 4.x
 and security. Then you will only see authenticated peers.

 On Wed, Jan 8, 2014 at 12:32 PM, Dmitriy Vsekhvalnov
 dvsekhval...@gmail.com wrote:
  Hi All,
 
  continue my little evaluation of zeromq and wanted to ask next question:
 is
  it possible to force disconnect of client from router side? (e.g.
 disconnect
  req or dealer).
 
  If it is not possible are those clients who connected to router socket
  consume resources? A lot? Even if no messages send/received from them?
 
  We are in environment where we don't trust peers until they complete
  handshake with router socket.
  And would like to disconnect them if handshake failed. (i know we can
 simply
  ignore them and keep connected).
 
  Thanks.
 
  ___
  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] [zmqpp] [libzmq] Wrapping zmq messages

2014-01-09 Thread Lindley French
After much head-banging, valgrinding, I've finally identified the problem.

Since msg stores the zmq_msg_t objects in a vector, and small enough
messages are stored directly in the zmq_msg_t rather than by pointer,
calling raw_new_msg() was actually invalidating some of the pointers I have
previously obtained from zmq_msg_data().

I was able to solve the problem by moving the emplace_back() to a separate
loop.

On Wed, Jan 8, 2014 at 4:44 PM, Lindley French lindl...@gmail.com wrote:

 Until we get UDP up and running in 0MQ, I'm using Boost.Asio for my UDP
 needs. However, my API uses zmqpp::message_t types, so I need to convert
 between these. This is easy enough when sending, since a
 boost::asio::buffer only needs a pointer and a size and these can be
 obtained from zmq message parts easily enough.

 On the receiving side, it's less clear to me what to do. zmqpp::message_t
 doesn't provide a way to add an uninitalized message part of a specified
 size (IMO, raw_new_msg ought to take a size parameter with a default of 0),
 and libzmq doesn't provide a simple way to resize and initialized message,
 so I'm doing this:

 vectormutable_buffer buffers; // ASIO scatter buffers
 buffers.reserve(nparts);
 // I've determined the number of zmq message parts to expect previously
 for (size_t i = 0; i  nparts; ++i)
 {
zmq_msg_t inplace = msg.raw_new_msg();
{
   zmq_msg_t newpart;
   zmq_msg_init_size(newpart,sizes[i+1]);
   zmq_msg_move(inplace,newpart);
   zmq_msg_close(newpart);
}
buffers.emplace_back(zmq_msg_data(inplace),
zmq_msg_size(inplace));
 }
 asio_udp.receive(buffers);

 However, I'm getting memory faults and I suspect this logic is to blame.
 Anyone see any problems with it?

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


Re: [zeromq-dev] How do we activate and connect to WiFi hotspots in edgenets?

2014-01-09 Thread Pieter Hintjens
On Thu, Jan 9, 2014 at 3:55 PM, Lindley French lindl...@gmail.com wrote:

 In the short term that may be the only solution that's workable without root
 access on at least some of the phones. I think the full benefits of EdgeNet
 won't be realized until arbitrary phones can serve as routers or data mules
 without the user knowing or caring, though.

Right.

 I still think WiFi Direct has a place in the solution, when it's available.
 According to Wikipedia, only one phone of a group has to support WiFi Direct
 for the entire group to use it.

That works precisely like a hotspot afaik (did not actually try that, though).

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


Re: [zeromq-dev] Router socket to force peer disconnect

2014-01-09 Thread Pieter Hintjens
JZMQ runs on ZeroMQ v4.0 and supports the security layers.

On Thu, Jan 9, 2014 at 5:03 PM, Dmitriy Vsekhvalnov
dvsekhval...@gmail.com wrote:
 I'd like to. But it doesn't seem to be possible with Java or CLR at the
 moment. And we don't have time/budget to invest in support right now.

 Thanks for answer.


 On Thu, Jan 9, 2014 at 6:19 PM, Pieter Hintjens p...@imatix.com wrote:

 If you don't trust your peers you should probably be using ZeroMQ 4.x
 and security. Then you will only see authenticated peers.

 On Wed, Jan 8, 2014 at 12:32 PM, Dmitriy Vsekhvalnov
 dvsekhval...@gmail.com wrote:
  Hi All,
 
  continue my little evaluation of zeromq and wanted to ask next question:
  is
  it possible to force disconnect of client from router side? (e.g.
  disconnect
  req or dealer).
 
  If it is not possible are those clients who connected to router socket
  consume resources? A lot? Even if no messages send/received from them?
 
  We are in environment where we don't trust peers until they complete
  handshake with router socket.
  And would like to disconnect them if handshake failed. (i know we can
  simply
  ignore them and keep connected).
 
  Thanks.
 
  ___
  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] vs110 via msbuild vs120 x64 a no go

2014-01-09 Thread Steven McCoy
In case anyone tries this, a recent update from Microsoft has some how
blocked this combination and causes a new unique error message:

C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(58,5):
error MSB8032: The Platform or PlatformToolset is not available from a
64bit environment.  Consider building from 32bit environment instead.

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


Re: [zeromq-dev] How do we activate and connect to WiFi hotspots in edgenets?

2014-01-09 Thread crocket
http://developer.android.com/guide/topics/connectivity/wifip2p.html tells
android has WiFi Direct capability since 4.0.
This is a good news. I'm not sure about iOS, but iPhones can connect
to WiFi-Direct-capable android phones.




On Fri, Jan 10, 2014 at 5:31 AM, Pieter Hintjens p...@imatix.com wrote:

 On Thu, Jan 9, 2014 at 3:55 PM, Lindley French lindl...@gmail.com wrote:

  In the short term that may be the only solution that's workable without
 root
  access on at least some of the phones. I think the full benefits of
 EdgeNet
  won't be realized until arbitrary phones can serve as routers or data
 mules
  without the user knowing or caring, though.

 Right.

  I still think WiFi Direct has a place in the solution, when it's
 available.
  According to Wikipedia, only one phone of a group has to support WiFi
 Direct
  for the entire group to use it.

 That works precisely like a hotspot afaik (did not actually try that,
 though).

 -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] How do we activate and connect to WiFi hotspots in edgenets?

2014-01-09 Thread crocket
Plus, I tested my nexus 5 and 7 with Super Beam app.
Super Beam shares files and folders using WiFi Direct.
My nexus devices successfully shared files via WiFi Direct.

WiFi Direct is confirmed to be working at least on nexus devices.


On Fri, Jan 10, 2014 at 5:31 AM, Pieter Hintjens p...@imatix.com wrote:

 On Thu, Jan 9, 2014 at 3:55 PM, Lindley French lindl...@gmail.com wrote:

  In the short term that may be the only solution that's workable without
 root
  access on at least some of the phones. I think the full benefits of
 EdgeNet
  won't be realized until arbitrary phones can serve as routers or data
 mules
  without the user knowing or caring, though.

 Right.

  I still think WiFi Direct has a place in the solution, when it's
 available.
  According to Wikipedia, only one phone of a group has to support WiFi
 Direct
  for the entire group to use it.

 That works precisely like a hotspot afaik (did not actually try that,
 though).

 -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] STREAM socket not closing.

2014-01-09 Thread Matt Connolly
Dear list,


I’m looking at using the STREAM socket to interface with some plain old TCP 
clients, however, there seems to be two things I’m missing:

1. How do I send a message to a client first? Once the client sends a message I 
can get the identity frame and use that to reply. How do I send a message 
before receiving any data?

2. Closing sockets. I see in the docs that a socket can be closed by sending 
the identity frame followed by a zero length frame. However, this does not seem 
to be working.

I’m expecting to successfully read 0 bytes from the TCP socket meaning that the 
connection was actively closed, and no error codes. Instead by TCP socket recv 
blocks forever. The only way I can get this to happen is to close the ZMQ 
socket, which is not possible when I am using bind and talking to multiple TCP 
clients.


Cheers,
Matt

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


[zeromq-dev] Notification of peer disconnection for ZMQ_STREAM sockets.

2014-01-09 Thread Chris Laws
In CZMQ and PYZMQ you can use the socket event monitor interface to receive
socket event notification of things such as connect, disconnect, accepted,
etc.

I use the zmonitor from CZMQ and zmq.utils.monitor.recv_monitor_message
from pyzmq for receiving connection state information in applications where
the connection state is important.

Perhaps you could check if this would satisfy your needs.

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