vendor/bundle/ruby/2.7.0/gems/dnsruby-1.61.5/lib/dnsruby/select_thread.rb
# Removes closed sockets from @@sockets, and returns an array containing 1
# exception for each closed socket contained in @@socket_hash.
Removes closed sockets from @@sockets, and returns an array containing 1
exception for each closed socket contained in @@socket_hash.
Removes closed sockets from @@sockets and returns an array containing 1 exception for each closed socket contained in @@socket_hash .
def clean_up_closed_sockets
      exceptions = @@mutex.synchronize do
        closed_sockets_in_hash = @@sockets.select(&:closed?).select { |s| @@socket_hash[s] }
        @@sockets.delete_if { | socket | socket.closed? }
        closed_sockets_in_hash.each_with_object([]) do |socket, exceptions|
          @@socket_hash[socket].each do | client_id |
            exceptions << [SocketEofResolvError.new("TCP socket closed before all answers received"), socket, client_id]
          end
        end
      end
    end
def clean_up_closed_sockets exceptions = @@mutex . synchronize do closed_sockets_in_hash = @@sockets . select ( & :closed? ) . select { | s | @@socket_hash [ s ] } @@sockets . delete_if { | socket | socket . closed? } closed_sockets_in_hash . each_with_object ( [ ] ) do | socket , exceptions | @@socket_hash [ socket ] . each do | client_id | exceptions << [ SocketEofResolvError . new ( "TCP socket closed before all answers received" ) , socket , client_id ] end end end end
Removes closed sockets from @@sockets, and returns an array containing 1
exception for each closed socket contained in @@socket_hash.
Removes closed sockets from @@sockets and returns an array containing 1 exception for each closed socket contained in @@socket_hash .