lib/sensu/server/handle.rb
def udp_handler(handler, event_data, event_id)
        begin
          EM::open_datagram_socket("0.0.0.0", 0, nil) do |socket|
            socket.send_datagram(event_data.to_s, handler[:socket][:host], handler[:socket][:port])
            socket.close_connection_after_writing
            @in_progress[:events] -= 1 if @in_progress
          end
        rescue => error
          handler_error(handler, event_data, event_id).call(error)
        end
      end
# Transmit event data to a UDP socket, then close the
# connection. The `@in_progress[:events]` is decremented by `1`
# when the data is assumed to have been transmitted.
#
# @param handler [Hash] definition.
# @param event_data [Object] to transmit to the UDP socket.
# @param event_id [String] event UUID
Transmit event data to a UDP socket, then close the
connection. The `@in_progress[:events]` is decremented by `1`
when the data is assumed to have been transmitted.
Transmit event data to a UDP socket then close the connection . The ` @in_progress [ : events ] ` is decremented by ` 1 ` when the data is assumed to have been transmitted .
def udp_handler(handler, event_data, event_id)
        begin
          EM::open_datagram_socket("0.0.0.0", 0, nil) do |socket|
            socket.send_datagram(event_data.to_s, handler[:socket][:host], handler[:socket][:port])
            socket.close_connection_after_writing
            @in_progress[:events] -= 1 if @in_progress
          end
        rescue => error
          handler_error(handler, event_data, event_id).call(error)
        end
      end
def udp_handler ( handler , event_data , event_id ) begin EM :: open_datagram_socket ( "0.0.0.0" , 0 , nil ) do | socket | socket . send_datagram ( event_data . to_s , handler [ :socket ] [ :host ] , handler [ :socket ] [ :port ] ) socket . close_connection_after_writing @in_progress [ :events ] -= 1 if @in_progress end rescue => error handler_error ( handler , event_data , event_id ) . call ( error ) end end
Transmit event data to a UDP socket, then close the
connection.
Transmit event data to a UDP socket then close the connection .
handler
None
event_data
to transmit to the UDP socket.
to transmit to the UDP socket .
event_id
None