[haiku-development] Re: socket and select

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 24 Feb 2011 12:44:14 +0100

Clemens <clemens.zeidler@xxxxxxxxxxxxxx> wrote:
> > Why are you passing 32 as the first parameter? Normally you should
> > pass the highest descriptor you want it to be looking at, which 
> > would
> > correspond to fSocket + 1 in your case. Not sure it explains your
> > particular problem, though it's possible.
> I copied it from the old IMAP code, already fixed it locally by using 
> the  
> FD_SETSIZE variable but this does not help, will try fSocket + 1 now

Which is the correct thing to do, as Rene pointed out.
But instead of using select(), you might want to use poll() instead 
which API is a lot more efficient to use (and more powerful, too).

Bye,
   Axel.


Other related posts: