Sha256: cc3a976473e101a7153c062bfd75e8ed73d41b2babdb564f90b3353d23c4c25b

Contents?: true

Size: 283 Bytes

Versions: 21

Compression:

Stored size: 283 Bytes

Contents

module Fluent
  module SocketUtil
    def create_udp_socket(host)
      require 'ipaddr'

      if IPAddr.new(IPSocket.getaddress(host)).ipv4?
        UDPSocket.new
      else
        UDPSocket.new(Socket::AF_INET6)
      end
    end
    module_function :create_udp_socket
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
fluentd-0.10.50 lib/fluent/plugin/socket_util.rb
fluentd-0.10.49 lib/fluent/plugin/socket_util.rb
fluentd-0.10.48 lib/fluent/plugin/socket_util.rb
fluentd-0.10.47 lib/fluent/plugin/socket_util.rb
fluentd-0.10.46 lib/fluent/plugin/socket_util.rb
fluentd-0.10.45 lib/fluent/plugin/socket_util.rb
fluentd-0.10.44 lib/fluent/plugin/socket_util.rb
fluentd-0.10.43 lib/fluent/plugin/socket_util.rb
fluentd-0.10.42 lib/fluent/plugin/socket_util.rb
fluentd-0.10.41 lib/fluent/plugin/socket_util.rb
fluentd-0.10.40 lib/fluent/plugin/socket_util.rb
fluentd-0.10.39 lib/fluent/plugin/socket_util.rb
fluentd-0.10.38 lib/fluent/plugin/socket_util.rb
fluentd-0.10.37 lib/fluent/plugin/socket_util.rb
fluentd-0.10.36 lib/fluent/plugin/socket_util.rb
fluentd-0.10.35 lib/fluent/plugin/socket_util.rb
fluentd-0.10.34 lib/fluent/plugin/socket_util.rb
fluentd-0.10.33 lib/fluent/plugin/socket_util.rb
fluentd-0.10.32 lib/fluent/plugin/socket_util.rb
fluentd-0.10.31 lib/fluent/plugin/socket_util.rb