[nanomsg] Re: Implementing nanomsg without select or poll functions

  • From: Moshe Tal <MoTal@xxxxxxxxxxxx>
  • To: "nanomsg@xxxxxxxxxxxxx" <nanomsg@xxxxxxxxxxxxx>
  • Date: Wed, 6 Aug 2014 16:50:50 +0300

I took the following way to manage this limitation:
In my poll() function I poll each socket.
First call to recv() function with MSG_PEEK option (read but don't remove data 
from the queue) to know if there is any data to get from sockets,.
Then I call to send() function with 0 length message to know if it is able to 
send data to the socket.

My problem is with the accept() function when I can't check the availability of 
connection in non-intrusive way.


Moshe Tal-Landau
Embedded Software Team Leader
Kramer Electronics


-----Original Message-----
From: nanomsg-bounce@xxxxxxxxxxxxx [mailto:nanomsg-bounce@xxxxxxxxxxxxx] On 
Behalf Of Martin Sustrik
Sent: Wednesday, August 06, 2014 3:15 PM
To: nanomsg@xxxxxxxxxxxxx
Subject: [nanomsg] Re: Implementing nanomsg without select or poll functions

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/08/14 13:16, Moshe Tal wrote:

> I need to implement the nanomsg for TCP stack that implement the BSD 
> socket API partially, it miss either poll() or select() functions.

They have no way to multiplex among several sockets?

How can you possibly implement a decent networking application on such platform?

Maybe they have some proprietary function to do the task?

Martin



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJT4hwbAAoJENTpVjxCNN9YAtUIAKUpbjD/hzb2E6MFk0QLFlUx
3h1PvbLtQ1wpyyEiuSyvI5KJRxoBYajBJIYz+zAaY95BWXSPiAErW28eh0GNeI+/
mGDUN8DWvbnvwLk5maWZ4fJ/5cqeQgdKZwQvw9y8O3QmGnSVFalXOXad+ftLA6oy
s5elNj9+TaGJ6lOYCOCluP0LT2WnhvjlNqA1JpNCfX8ARthA3M7UsFk6MDi8Sx3U
WO2rsrxzoVEu3DqcCd1Vkwn5t1n2om6sflB3h15Zvtr1xpJlPTqxOXHlvB2Inflb
rcvuKhIt/CvTg9inKaOARBNkfPBEiaqnXJu+ehh67sAeHlXw9sBYuq6tuu4oxBQ=
=vHpZ
-----END PGP SIGNATURE-----


This mail was sent via Mail-SeCure System.



Other related posts: