    # File lib/stella/utils.rb, line 307
        def service_available?(host, port, wait=3)
          if Stella.sysinfo.vm == :java
            begin
              iadd = Java::InetSocketAddress.new host, port
              socket = Java::Socket.new
              socket.connect iadd, wait * 1000  # milliseconds
              success = !socket.isClosed && socket.isConnected
            rescue NativeException => ex
              puts ex.message, ex.backtrace if Stella.debug?
              false
            end
          else
            begin
              status = Timeout::timeout(wait) do
                socket = Socket.new( AF_INET, SOCK_STREAM, 0 )
                sockaddr = Socket.pack_sockaddr_in( port, host )
                socket.connect( sockaddr )
              end
              true
            rescue Errno::EAFNOSUPPORT, Errno::ECONNREFUSED, SocketError, Timeout::Error => ex
              puts ex.class, ex.message, ex.backtrace if Stella.debug?
              false
            end
          end
        end