Sha256: c459672a0f2a381af55f8c60a954166891cc8aafe75056a0c4354c810b102cc1

Contents?: true

Size: 530 Bytes

Versions: 7

Compression:

Stored size: 530 Bytes

Contents

# frozen_string_literal: true

module Ftpd

  module DataServerFactory

    # Factory for creating TCPServer used for passive mode connections.
    # This factory binds to a random ephemeral port.
    class RandomEphemeralPort

      # @param interface [String] The IP address of the interface to
      #   bind to (e.g. "127.0.0.1")
      def initialize(interface)
        @interface = interface
      end

      # @return [TCPServer]
      def make_tcp_server
        TCPServer.new(@interface, 0)
      end

    end

  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ftpd-2.1.0 lib/ftpd/data_server_factory/random_ephemeral_port.rb
ftpd-2.0.5 lib/ftpd/data_server_factory/random_ephemeral_port.rb
ftpd-2.0.4 lib/ftpd/data_server_factory/random_ephemeral_port.rb
ftpd-2.0.3 lib/ftpd/data_server_factory/random_ephemeral_port.rb
ftpd-2.0.2 lib/ftpd/data_server_factory/random_ephemeral_port.rb
ftpd-2.0.1 lib/ftpd/data_server_factory/random_ephemeral_port.rb
ftpd-2.0.0 lib/ftpd/data_server_factory/random_ephemeral_port.rb