Sha256: 58883452c7c38396a1cec3ec7d13ff371c1cf95d1e289da52ff21f1cd0dd4118
Contents?: true
Size: 569 Bytes
Versions: 15
Compression:
Stored size: 569 Bytes
Contents
name 'udp responder' always_start true default[:host], default[:port] = Kurchatov::Config[:udp_responder].to_s.split(":") run_if do !!Kurchatov::Config[:udp_responder] end helpers do def process(data, src) begin event(JSON.parse(data)) src.reply "sended\n\n" rescue => e src.reply "failed to send: #{data.inspect}\n" Log.error("Failed parse #{data.inspect}, #{e.class}: #{e}\n #{e.backtrace.join("\n")}") end end end run do Socket.udp_server_loop(plugin.host, plugin.port) do |data, src| process(data, src) end end
Version data entries
15 entries across 15 versions & 1 rubygems