tcp socket.gets doesn't work with a custom line separator
---------------------------------------------------------
Key: JRUBY-4387
URL: http://jira.codehaus.org/browse/JRUBY-4387
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.5
Environment: MacOS X 10.5.8
Reporter: Stephen Bannasch
I was trying to get Hiroshi Ichikawa's ruby web-socket library working:
http://github.com/gimite/web-socket-ruby
It works fine in MRI (tested w/1.8.6) but reading from the TCPSocket doesn't
work when a custom separator delimiter is specified. T
Socket#gets("\377")
Should get a line delimited with FF bytes.
I will be attaching a diff with the following new test in test/test_socket.rb
Here is how to easily test using
{code}
git clone git://github.com/gimite/web-socket-ruby.git
cd web-socket-ruby
ruby samples/echo_server.rb localhost 10081
# in another shell ...
ruby samples/stdio_client.rb ws://localhost:10081
{code}
Now type a line of chars into the stdio client -- they will be received by the
server and echoed back.
If you try this in JRuby the server will hang processing:
line = @socket.gets(rs)
The char \377 is used to delimit the end of a frame.
server will never receive
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email