This prog keeps stopping again and again

i have put enough exception handlers. but this prog keeps stalling
after some time. how do i fix it.

Wed Sep 24 10:30:16 -0700 2008
Wed Sep 24 10:30:22 -0700 2008
c:/ruby/lib/ruby/1.8/openssl/buffering.rb:35:in sysread': An existing connectio n was forcibly closed by the remote host. (Errno::ECONNRESET) from c:/ruby/lib/ruby/1.8/openssl/buffering.rb:35:infill_rbuff’
from c:/ruby/lib/ruby/1.8/openssl/buffering.rb:106:in gets' from c:/ruby/lib/ruby/1.8/net/imap.rb:991:inget_response’
from c:/ruby/lib/ruby/1.8/net/imap.rb:929:in
receive_responses' from c:/ruby/lib/ruby/1.8/net/imap.rb:922:ininitialize’
from c:/ruby/lib/ruby/1.8/net/imap.rb:921:in start' from c:/ruby/lib/ruby/1.8/net/imap.rb:921:ininitialize’
from ./imDaveAlerts.rb:13:in new' from ./imDaveAlerts.rb:13:indoAlerts’
from C:/toronto/app/helpers/myCron.rb:10
from c:/ruby/lib/ruby/gems/1.8/gems/timeoutx-0.3.0/lib/
timeoutx.rb:58:in
`timeout’
from C:/toronto/app/helpers/myCron.rb:7

require ‘imDaveAlerts’
require “timeoutx”

while(true)

puts Time.now
begin
TimeoutX.timeout(15){
begin
a=DaveAlerts.new
a.doAlerts()
rescue Exception
print Exception.to_s
end
}
rescue Exception
print Exception.to_s
end
sleep(5)
end

On 24.09.2008 21:58, Junkone wrote:

i have put enough exception handlers. but this prog keeps stalling
after some time. how do i fix it.

Few things come to mind:

  1. configuration on the target system (close after time)

  2. why do you use sysread?

Kind regards

robert

On Sep 24, 4:29 pm, Robert K. [email protected] wrote:

Kind regards

    robert

sysread comes from Net\imap.
i am using imap to connect to gmail to get my emails and IM myself.
however, you can see i have enough exception handers. why does the
exception not get caught and the loop continrues. otherwise why is the
process not terminated by TimeoutX.timeout and the loop continues