Socket.close_write causes ClassCastException
--------------------------------------------

                 Key: JRUBY-2146
                 URL: http://jira.codehaus.org/browse/JRUBY-2146
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.1RC2
         Environment: Windows XP Pro, Java 1.5
            Reporter: Daniel Berger


This snippet demonstrates the problem with JRuby and Socket#close_write:
{noformat}
require 'socket'

socket = TCPServer.new('localhost', 9999)
socket.close_write
socket.close unless socket.closed?
{noformat}
Exception in thread "main" java.lang.ClassCastException: 
sun.nio.ch.ServerSocketChannelImpl
        at 
org.jruby.ext.socket.RubyBasicSocket.close_write(RubyBasicSocket.java:103)
        at org.jruby.RubyIOInvoker$close_write_method_0_0.call(Unknown Source)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:181)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:329)
        at 
ruby.C_3a_.Documents_20_and_20_Settings.djberge.workspace.ruby_test.test.__file__(test.rb:5)
        at 
ruby.C_3a_.Documents_20_and_20_Settings.djberge.workspace.ruby_test.test.load(test.rb)
        at org.jruby.Ruby.runScript(Ruby.java:491)
        at org.jruby.Ruby.runNormally(Ruby.java:411)
        at org.jruby.Ruby.runFromMain(Ruby.java:291)
        at org.jruby.Main.run(Main.java:142)
        at org.jruby.Main.run(Main.java:88)
        at org.jruby.Main.main(Main.java:79)



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


Reply via email to