[haiku-development] socket and select

  • From: Clemens <clemens.zeidler@xxxxxxxxxxxxxx>
  • To: "haiku-development@xxxxxxxxxxxxx" <haiku-development@xxxxxxxxxxxxx>
  • Date: Thu, 24 Feb 2011 11:46:07 +1300

Hi,

I'm running into the following problem. In IMAP idle mode I'm waiting for data using the select method. The connection is unencrypted / normal socket connection. Everything seems to work fine but after some time select returns immediately and returns 1 which means that one file descriptor has data to read. When I read the socket I just get 0 byte back. So there is actually nothing to read. Since I try to read a complete line this results in a busy loop... The IMAP connection is still working fine and I still can fetch mails or getting IDLE notifications... Only select does not wait any more!

This weird behaviour always occurs after the server send a special response (it says that there is a new message, which actually is not there, and that this message has removed again). Since the IMAP connection is still working afterwards I'm not sure why this trigger the failure of select.

Could somebody take a look at *) line 203. Is there something wrong with the usage of select?

Any idea why select stops working probably?

Regards,
        Clemens


*)
http://haiku.it.su.se:8180/source/xref/src/add-ons/mail_daemon/inbound_protocols/imap/imap_lib/ServerConnection.cpp

Other related posts: