Sha256: c2f3753eceb69da81ae3ab1ec7ce4bf9e71a721edb8d5278c213a8223d9461ee

Contents?: true

Size: 842 Bytes

Versions: 6

Compression:

Stored size: 842 Bytes

Contents

require 'socket'

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

module Raven
  module Transports
    class UDP < Transport
      def send_event(auth_header, data, _options = {})
        conn.send "#{auth_header}\n\n#{data}", 0
      end

      def send(auth_header, data, options = {})
        Raven.logger.warn "DEPRECATION WARNING: Calling #send on a Transport will be \
          removed in Raven-Ruby 0.14! Use #send_event instead!"
        send_event(auth_header, data, options)
      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

6 entries across 6 versions & 1 rubygems

Version Path
sentry-raven-0.15.2 lib/raven/transports/udp.rb
sentry-raven-0.15.1 lib/raven/transports/udp.rb
sentry-raven-0.15.0 lib/raven/transports/udp.rb
sentry-raven-0.14.0 lib/raven/transports/udp.rb
sentry-raven-0.13.3 lib/raven/transports/udp.rb
sentry-raven-0.13.2 lib/raven/transports/udp.rb