Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.6RC2
    • Fix Version/s: JRuby 1.7.0.pre1
    • Component/s: JRuby-extras
    • Labels:
      None
    • Environment:
      Linux
    • Number of attachments :
      0

      Description

      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)

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

      The socket path is /tmp/dbus-kvq7FW2 and the error message raised is

      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'
      

        Activity

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Thomas Kruse
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: