[ruby-list:50579] Re: IMAP IDLE
From:
Shugo Maeda <shugo@...>
Date:
2017-09-05 08:12:22 UTC
List:
ruby-list #50579
前田です。
2017年8月31日 14:00 <emo@nifs.ac.jp>:
> 上記のようなコードを実行しているのですが、
> 教えていただいたコードのままだと、以下のような例外が
> 送出されます。
>
> % ./check_mail.rb
> /usr/lib/ruby/2.3.0/net/imap.rb:962:in `block in idle'
> /usr/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
> /usr/lib/ruby/2.3.0/net/imap.rb:952:in `idle'
> ./check_mail.rb:56:in `<main>'connection closed: reconecting...
モンキーパッチだとContinuationRequestなどの定数が見つからないせいではないかと思います。
以下のコードでどうでしょうか。
class Net::IMAP::ResponseParser
def continue_req
match(T_PLUS)
token = lookahead
if token.symbol == T_SPACE
shift_token
return Net::IMAP::ContinuationRequest.new(resp_text, @str)
else
return Net::IMAP::ContinuationRequest.new(Net::IMAP::ResponseText.new(nil,
""), @str)
end
end
end
--
Shugo Maeda