Sha256: 77a7dbcc117e0638bad5c54e66178a3c6ee01622a3db46831137611588185468

Contents?: true

Size: 635 Bytes

Versions: 6

Compression:

Stored size: 635 Bytes

Contents

require 'minitest/autorun'
require 'dnssd'

class TestDNSSDReplyBrowse < MiniTest::Unit::TestCase

  def setup
    @reply = DNSSD::Reply::Browse.new nil, 0, 0, "blackjack\\032no\\032port",
                                      '_blackjack._tcp', 'local'
  end

  def test_connect
    port = Socket.getservbyname 'blackjack'
    server = TCPServer.new nil, port
    Thread.start do server.accept end

    DNSSD.announce server, 'blackjack no port'

    socket = @reply.connect

    assert_instance_of TCPSocket, socket
    assert_equal port, socket.peeraddr[1]
  ensure
    socket.close if socket
    server.close if server
  end

end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
dnssd-1.3.4 test/test_dnssd_reply_browse.rb
dnssd-1.3.3 test/test_dnssd_reply_browse.rb
dnssd-1.3.2 test/test_dnssd_reply_browse.rb
rackjour-0.1.8 vendor/gems/gems/dnssd-1.3.1/test/test_dnssd_reply_browse.rb
dnssd-1.3.1 test/test_dnssd_reply_browse.rb
dnssd-1.3 test/test_dnssd_reply_browse.rb