Am 23.11.2010, 12:55 Uhr, schrieb Donn Cave <donn@xxxxxxxxxxx>:
Quoth "Clemens Zeidler" <clemens.zeidler@xxxxxxxxxxxxxx>,If there is no such class whats the best way to read all available data? In case of ssl, SSL_pending returns the number of bytes in the queue. Whats about socket's? is there a performance difference between readingonly one byte from a socket or multiple byte at one go? (the current imap client only reads one byte at a time till it found the stop byte) To read all available bytes, should I create a none blocking socket and read intoa buffer till I get a EWOULDBLOCK? or does it also work with a blocking socket?Here is how I do it. I support only an SSL connection, and I use only SSL_read() and SSL_write() to transfer data.
so you just read one byte in a SSL_read()?
The connection to the (each) IMAP server is implemented in its own thread, which basically runs a read_port()/imap-command/imap-receive/ write_port() loop. The messages to the IMAP port may include one that's sent on a pulse cycle, for a NOOP command. (Don't bother with IDLE, it isn't worth the headache.)
actually I like the IDLE feature and will definitely give it try you have write your own IMAP client? is it open source? thanks, Clemens