Skip to content
This repository was archived by the owner on Dec 18, 2023. It is now read-only.
This repository was archived by the owner on Dec 18, 2023. It is now read-only.

Resolve issues while scanning for printer #22

@g00m

Description

@g00m

I scan with the following code example for printers. After about 40 rounds in the for loop the following error appears:

compat.c: write() failed: Bad file descriptor
ruby: compat.c:425: sdref_free: Assertion `__ret == 0' failed.
compat.c: write() failed: Broken pipe
compat.c: read() failed: EOF

Any ideas how to fix this? Looks like it is crashing in the avahi-lib in this line:

ASSERT_SUCCESS(write_command(sdref->main_fd, COMMAND_QUIT));

require 'dnssd'

service =  '_http._tcp' #network printer
resolved = []

i = 1
while i <=100
 DNSSD.browse service do |b|
   DNSSD.resolve(b) do |r|
     resolved << r
   end
 end

 sleep 0.5
 puts "***** Round #{i} *****"
 resolved.each do |r|
   puts r.fullname
 end
 i+=1
 resolved = []
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions