JRuby does not detect unix socket
---------------------------------

                 Key: JRUBY-5560
                 URL: http://jira.codehaus.org/browse/JRUBY-5560
             Project: JRuby
          Issue Type: Bug
          Components: JRuby-extras
    Affects Versions: JRuby 1.6RC2
         Environment: Linux
            Reporter: Thomas Kruse


I tried to use the ruby-dbus gem to create desktop notifications from jruby. 
While it works in native ruby, jruby complains about the socket address.
It would be great, if jruby could detect the unix socket type and use the 
RubyUNIXSocket appropriately instead raising an exception.

Code triggering the behaviour (from bus.rb in the dbus gem)

{code}
@socket = Socket.new(Socket::Constants::PF_UNIX,Socket::Constants::SOCK_STREAM, 
0)
      @socket.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
      if ! params['abstract'].nil?
        if HOST_END == LIL_END
          sockaddr = "\1\0\0#{params['abstract']}"
        else
          sockaddr = "\0\1\0#{params['abstract']}"
        end
      elsif ! params['path'].nil?
        sockaddr = Socket.pack_sockaddr_un(params['path'])
      end
      @socket.connect(sockaddr)
{code}

The socket path is /tmp/dbus-kvq7FW2 and the error message raised is
{code}
org/jruby/ext/socket/RubySocket.java:557:in `unpack_sockaddr_in': can't resolve 
socket address of wrong type (ArgumentError)
        from org/jruby/ext/socket/RubySocket.java:377:in `connect'
        from /home/tkruse/NetBeansProjects/Notify/rblib/dbus/bus.rb:269:in 
`connect_to_unix'
{code}

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