Module: Fluent::Compat::SocketUtil

Defined in:
lib/fluent/compat/socket_util.rb

Defined Under Namespace

Classes: BaseInput, TcpHandler, UdpHandler

Class Method Summary collapse

Class Method Details

.create_udp_socket(host) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/fluent/compat/socket_util.rb', line 27

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