Sha256: 497265dad34750ad4b75b00ddda131bf3ea29b39ce709703082f99be72a4f57d

Contents?: true

Size: 156 Bytes

Versions: 6

Compression:

Stored size: 156 Bytes

Contents

module Network

  def self.find_available_port
    server = TCPServer.new('127.0.0.1', 0)
    server.addr[1]
  ensure
    server.close if server
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
dblink-0.4.3 lib/dblink/network.rb
dblink-0.4.2 lib/dblink/network.rb
dblink-0.4.1 lib/dblink/network.rb
dblink-0.4 lib/dblink/network.rb
dblink-0.3 lib/dblink/network.rb
dblink-0.2 lib/dblink/network.rb