Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > How can an I use nonblocking I/O with openssl?

Reply
Thread Tools

How can an I use nonblocking I/O with openssl?

 
 
Yaxm Yaxm
Guest
Posts: n/a
 
      02-06-2009
hello,
I am using ruby's imap library to connect to gmail via ssl.
But every now and then, my thread goes into sleep and never wakes up.
I suspect that the thread is waiting for I/O for reading.

how can I make openssl use nonblocking i/o?

here's another thread discussed about similar issue:
http://www.ruby-forum.com/topic/70716

Thanks.
Yaxm
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Tony Arcieri
Guest
Posts: n/a
 
      02-06-2009
[Note: parts of this message were removed to make it a legal post.]

On Fri, Feb 6, 2009 at 11:45 AM, Yaxm Yaxm
<snowstorm+<snowstorm%2Brubyfor >
> wrote:


> hello,
> I am using ruby's imap library to connect to gmail via ssl.
> But every now and then, my thread goes into sleep and never wakes up.
> I suspect that the thread is waiting for I/O for reading.
>
> how can I make openssl use nonblocking i/o?
>


In my event library Rev (http://rev.rubyforge.org) I ended up effectively
monkeypatching the C code in the Ruby OpenSSL extension in order to support
non-blocking I/O:

http://github.com/tarcieri/rev/blob/.../rev/rev_ssl.c

I for one would certainly appreciate a "real" solution to doing non-blocking
SSL.

--
Tony Arcieri
medioh.com

 
Reply With Quote
 
 
 
 
Yaxm Yaxm
Guest
Posts: n/a
 
      02-07-2009
I am very interested in as I need IMAP ssl to use non-blocking i/o.

Tony Arcieri wrote:
> On Fri, Feb 6, 2009 at 11:50 AM, Tony Arcieri <> wrote:
>
>> I for one would certainly appreciate a "real" solution to doing
>> non-blocking SSL.
>>

>
> If there's interest I can release Rev's nonblocking SSL support as a
> self-contained Gem which monkeypatches connect_nonblock,
> accept_nonblock,
> read_nonblock, and write_nonblock methods into OpenSSL::SSL::Socket.


--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Tony Arcieri
Guest
Posts: n/a
 
      02-07-2009
[Note: parts of this message were removed to make it a legal post.]

On Fri, Feb 6, 2009 at 10:00 PM, Yaxm Yaxm
<snowstorm+<snowstorm%2Brubyfor >
> wrote:


> I am very interested in as I need IMAP ssl to use non-blocking i/o.
>


All right, well I released non-blocking OpenSSL support as a gem.

github repo here:
http://github.com/tarcieri/openssl-nonblock/tree/master

release announcement here:
http://www.nabble.com/-ANN--openssl-...o21885626.html

And now installable as "gem install openssl-nonblock"

Let me know if it works out for you.

--
Tony Arcieri
medioh.com

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
nonblocking sockets nooneinparticular314159@yahoo.com Java 2 04-08-2006 09:41 AM
strange problem with nonblocking sockets anki C Programming 3 03-01-2005 05:26 AM
nonblocking read() Peter Ammon Python 3 11-17-2004 12:54 AM
setSoTimeout in nonblocking mode? KimTaehwan Java 0 11-16-2003 01:51 AM



Advertisments