Sha256: 06172dc352408697f35a59bb198ae188d47fbf873bab1fcbe0771b378ffa8a3f

Contents?: true

Size: 603 Bytes

Versions: 2

Compression:

Stored size: 603 Bytes

Contents

module GELF
  # Plain Ruby UDP sender.
  class RubyUdpSender
    def initialize(host, port)
      @host, @port = host, port
      @socket = UDPSocket.open
    end

    def send_datagrams(datagrams)
      datagrams.each do |datagram|
        @socket.send(datagram, 0, @host, @port)
      end
    end
  end

  # Plain Ruby TCP sender.
  class RubyTcpSender
    def initialize(host, port)
      @host, @port = host, port
      @socket = TCPSocket.open
    end

    def send_datagrams(datagrams)
      datagrams.each do |datagram|
        @socket.send(datagram, 0, @host, @port)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gelf-1.1.0.gamma1 lib/gelf/ruby_sender.rb
gelf-1.1.0.beta6 lib/gelf/ruby_sender.rb