This exposes a bug in JRuby w/r/t socket reads hanging in certain conditions.
Run the server. Connect with a client. Get a pong. Send 2 chars from the client. Read them one at a time successfully from the server.
In celluloid-io master, works as expected. In this branch, first readpartial(1) succeeds. Second hangs indefinitely.
Make sure this branch is active in the Gemfile.
bundle
bundle exec ruby ssl.rb
In another console, run:
openssl s_client -ssl3 -connect localhost:11443
See the pong from the client. Type "GE"
From the pry console that opens in the server, type:
socket.readpartial(1)
# => "G"
$lolflag = true # So my binding.pry in celluloid-io triggers
socket.readpartial(1)
# Enters pry, after which:
# Kernel.select([@io])
# HANGS INDEFINITELY
# but...
# @io.read_nonblock(1)
# returns "E" as expected