[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

this prog keeps stopping again and again

Junkone

9/24/2008 7:58:00 PM

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
2 Answers

Robert Klemme

9/24/2008 8:30:00 PM

0

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

Junkone

9/25/2008 3:12:00 PM

0

On Sep 24, 4:29 pm, Robert Klemme <shortcut...@googlemail.com> wrote:
> 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

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