Sha256: 2bffa3615b01b129ecc94d04409783c12e224c7a2364ac91e919284d7a77da64

Contents?: true

Size: 580 Bytes

Versions: 3

Compression:

Stored size: 580 Bytes

Contents

require 'socket'

require 'raven/transports'
require 'raven/error'

module Raven
  module Transports
    class UDP < Transport

      def send(auth_header, data, _options = {})
        conn.send "#{auth_header}\n\n#{data}", 0
      end

    private

      def conn
        @conn ||= begin
          sock = UDPSocket.new
          sock.connect(self.configuration.host, self.configuration.port)
          sock
        end
      end

      def verify_configuration
        super
        raise Error.new('No port specified') unless self.configuration.port
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sentry-raven-0.13.1 lib/raven/transports/udp.rb
sentry-raven-0.13.0 lib/raven/transports/udp.rb
sentry-raven-0.12.3 lib/raven/transports/udp.rb