Overview
Features
Download
Documentation
Community
Add-Ons & Services

Non-blocking sockets

A general discussion forum.

Non-blocking sockets

Postby thready » 09 Jun 2010, 18:43

Hi Poco experts,

If I set a socket to non-blocking, what does that mean exactly? If I do a read, it will immediately return? Is there some callback function that will get called if I do that? (I'd love it if it worked like that)...

Thanks,
Mike
thready
 
Posts: 39
Joined: 20 Jan 2010, 17:20

Re: Non-blocking sockets

Postby guenter » 10 Jun 2010, 13:30

It basically means that a call to receiveBytes() may return a negative return value, denoting that no data is available. You'll usually use select() or poll() get wait until data becomes available. The details are a bit more complicated; refer to Stevens or the Socket FAQ.
guenter
 
Posts: 1112
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: Non-blocking sockets

Postby aderouineau » 11 Jun 2010, 18:43

When will POCO support kqueue/epoll for linux ? Even for level-triggered they work better.

Of course it would be unbelievably great to have a proactor implementation ^^
aderouineau
 
Posts: 163
Joined: 18 May 2009, 17:38

Re: Non-blocking sockets

Postby guenter » 11 Jun 2010, 22:44

We'll have Linux epoll support in 1.3.7.
guenter
 
Posts: 1112
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: Non-blocking sockets

Postby mongmong » 24 Jun 2010, 04:49

guenter wrote:We'll have Linux epoll support in 1.3.7.


That will be great!

Are you going to implement the epoll support from scratch or by using some existed mature wrapper, like libevent?
mongmong
 
Posts: 1
Joined: 24 Jun 2010, 04:32


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest