this prog keeps stopping again and again

J

Junkone

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:in
`fill_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:in `get_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:in `initialize'
from c:/ruby/lib/ruby/1.8/net/imap.rb:921:in `start'
from c:/ruby/lib/ruby/1.8/net/imap.rb:921:in `initialize'
from ./imDaveAlerts.rb:13:in `new'
from ./imDaveAlerts.rb:13:in `doAlerts'
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
 
R

Robert Klemme

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
 
J

Junkone

Few things come to mind:

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

2. why do you use sysread?

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top