Re: ssl_read() hangs after wakeup from sleep in OSX 10.5.8

2009-10-30 Thread Parimal Das
Hi The c-client library/API does its own socket I/O for non-SSL sessions, but in SSL the socket I/O is delegated to OpenSSL. When c-client does its own socket I/O, it sets a timeout (normally 15 seconds) on a select() call prior to doing any read() or write() calls. Thus, c-client never does a

Re: ssl_read() hangs after wakeup from sleep in OSX 10.5.8

2009-10-30 Thread Parimal Das
Sorry, I forgot to mention that c-client library/API is part of IMAP-2009 library (http://www.panda.com/imap/) I am using IMAP library, which in turn using OpenSSL. I am re-posting my last post here. The IMAP(2009) c-client library/API does its own socket I/O for non-SSL sessions, but in SSL the

RE: ssl_read() hangs after wakeup from sleep in OSX 10.5.8

2009-10-30 Thread David Schwartz
Parimal Das wrote: The IMAP(2009) c-client library/API does its own socket I/O for non-SSL sessions, but in SSL the socket I/O is delegated to OpenSSL. When c-client does its own socket I/O, it sets a timeout (normally 15 seconds) on a select() call prior to doing any read() or write()

RE: ssl_read() hangs after wakeup from sleep in OSX 10.5.8

2009-10-29 Thread David Schwartz
Parimal Das wrote: Its the second case Darry, Here the 'sleep' is Operating System Sleep mode induced by closing the lid of laptop. After opening the laptop, when the system wakes up, My application is always hanging at the same place. Bug is in your code. It is doing what you asked it do

Re: ssl_read() hangs after wakeup from sleep in OSX 10.5.8

2009-10-29 Thread Parimal Das
Hello, Here is my test code. I am downloading a file with https connection. This is compiled as $g++ -lssl -lcrypto sslShow.cpp. on OS X 10.5.8 Using default OS X libs (libcrypto 0.9.7 and libssl 0.9.7) When it has downloaded some 2MB data, I closed my laptop lid (OSX induced sleep) After 5

RE: ssl_read() hangs after wakeup from sleep in OSX 10.5.8

2009-10-29 Thread David Schwartz
Parimal Das wrote: Please suggest. 1. What i should include in this code to correct this hang? It depends on what your code should do in this case. Do you want to wait a limited amount of time for the other side to reply? Or do you want to wait possibly forever? Your current code

Re: ssl_read() hangs after wakeup from sleep in OSX 10.5.8

2009-10-29 Thread Graham Swallow
google: TCP OPTION KEEPALIVE http://tldp.org/HOWTO/html_single/TCP-Keepalive-HOWTO/ You would be best with an application level timeout, which would send an application enquiry (heartbeat) from the laptop to the server. Waking up from sleeping, the application would send the next heartbeat. (any

Re: ssl_read() hangs after wakeup from sleep in OSX 10.5.8

2009-10-28 Thread Darryl Miles
Parimal Das wrote: Its the second case Darry, Here the 'sleep' is Operating System Sleep mode induced by closing the lid of laptop. After opening the laptop, when the system wakes up, My application is always hanging at the same place. It is possible there is something specific OSX does in

ssl_read() hangs after wakeup from sleep in OSX 10.5.8

2009-10-27 Thread Parimal Das
Hello people I am getting a hang by doing the following IF i put my OS X laptop in sleep, when ssl_getbuffer() is getting performed, On waking up, the thread hangs. The call trace is as follows 562 mail_fetch_message 562 imap_msgdata

Re: ssl_read() hangs after wakeup from sleep in OSX 10.5.8

2009-10-27 Thread Darryl Miles
after wakeup from sleep ? What do you mean ? Do you mean you used an API like poll() or select() to put the thread to sleep and then it wakes up and the socket readability was indicated ? If so please post an outline of the code your sleep/wake mechanism you are using. Do you mean your

Re: ssl_read() hangs after wakeup from sleep in OSX 10.5.8

2009-10-27 Thread Parimal Das
Its the second case Darry, Here the 'sleep' is Operating System Sleep mode induced by closing the lid of laptop. After opening the laptop, when the system wakes up, My application is always hanging at the same place.* * 562 ssl_getbuffer 562 ssl_getdata