Class: Easyjour::Search

Class | Easyjour::Search
In: | lib/easyjour.rb lib/easyjour.rb
Parent: | Object

### Methods

new new results results stop stop

### Public Class methods

new(service, protocol = :tcp) {|reply| ...}

[Source]

        # File lib/easyjour.rb, line 78
    78:     def initialize(service, protocol = :tcp)
    79:       @results = []
    80:       @results_mutex = Mutex.new
    81:
    82:       @query = DNSSD.browse(Easyjour.type_from_parts(service, protocol)) do |reply|
    83:         DNSSD.resolve(reply.name, reply.type, reply.domain) do |reply|
    84:           yield(reply) if block_given?
    85:
    86:           @results_mutex.synchronize do
    87:             @results << reply
    88:           end
    89:         end
    90:       end
    91:     end

new(service, protocol = :tcp) {|reply| ...}

[Source]

        # File lib/easyjour.rb, line 78
    78:     def initialize(service, protocol = :tcp)
    79:       @results = []
    80:       @results_mutex = Mutex.new
    81:
    82:       @query = DNSSD.browse(Easyjour.type_from_parts(service, protocol)) do |reply|
    83:         DNSSD.resolve(reply.name, reply.type, reply.domain) do |reply|
    84:           yield(reply) if block_given?
    85:
    86:           @results_mutex.synchronize do
    87:             @results << reply
    88:           end
    89:         end
    90:       end
    91:     end

### Public Instance methods

results()

Returns the current the results.

[Source]

        # File lib/easyjour.rb, line 94
    94:     def results
    95:       @results_mutex.synchronize do
    96:         @results
    97:       end
    98:     end

results()

Returns the current the results.

[Source]

        # File lib/easyjour.rb, line 94
    94:     def results
    95:       @results_mutex.synchronize do
    96:         @results
    97:       end
    98:     end

stop()

Stop the search.

[Source]

         # File lib/easyjour.rb, line 101
    101:     def stop
    102:       @query.stop
    103:     end

stop()

Stop the search.

[Source]

         # File lib/easyjour.rb, line 101
    101:     def stop
    102:       @query.stop
    103:     end

[Validate]