Sha256: c790242d1b0c91d49ec8dc27f9ec17e2cd27eace46fbb2440a79b1848d4b5544

Contents?: true

Size: 622 Bytes

Versions: 1

Compression:

Stored size: 622 Bytes

Contents

class AppDelegate
  def application(application, didFinishLaunchingWithOptions:launchOptions)
    @service = NetService.new(:name => "foobar", :port => 8080).tap do |ns|
      ns.on_did_publish do
        puts "HELLO"
      end
      ns.on_did_not_resolve do |error|

      end
    end
    @service.publish

    p "SEARCHING NOW."
    @n = NetServiceBrowser.search('_ssh._tcp') do |service, more_coming|
      s = service.instance_variable_get(:@net_service)
      p "name: #{s.name}, addresses: #{s.addresses.first}"
      p "SERVICE FOUND: #{s.hostName}"
      p "MORE COMING: #{more_coming}"
    end
    true
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
motion-net-service-0.0.1 app/app_delegate.rb