class Fluent::Plugin::NetflowipfixInput::PortConnection

Public Class Methods

new(bind, port, tag, cache_ttl, definitions, queuesleep, log) click to toggle source
# File lib/fluent/plugin/in_netflowipfix.rb, line 33
def initialize(bind, port, tag, cache_ttl, definitions, queuesleep, log)
        @bind = bind
        @port = port
        @tag = tag
        @cache_ttl = cache_ttl
        @definitions = definitions
        @eventQueue = Queue.new
        @udpQueue = Queue.new
        @queuesleep = queuesleep
        @log = log
end

Public Instance Methods

bind() click to toggle source
# File lib/fluent/plugin/in_netflowipfix.rb, line 45
def bind
        @bind
end
event_pop() click to toggle source
# File lib/fluent/plugin/in_netflowipfix.rb, line 78
def event_pop
        @eventQueue.pop
end
event_queue_length() click to toggle source
# File lib/fluent/plugin/in_netflowipfix.rb, line 82
def event_queue_length
        @eventQueue.length
end
port() click to toggle source
# File lib/fluent/plugin/in_netflowipfix.rb, line 48
def port
        @port
end
restartParser() click to toggle source
# File lib/fluent/plugin/in_netflowipfix.rb, line 68
def restartParser
        if !@thread_parser.nil?
                @thread_parser.close
                @thread_parser.join
                @thread_parser = nil
        end
        @thread_parser = ParserThread.new(@udpQueue, @queuesleep, @eventQueue, @cache_ttl, @definitions, @log)
        @thread_parser.start
end
start() click to toggle source
# File lib/fluent/plugin/in_netflowipfix.rb, line 55
def start
        @thread_udp = UdpListenerThread.new(@bind, @port, @udpQueue, @tag, @log)
        @thread_parser = ParserThread.new(@udpQueue, @queuesleep, @eventQueue, @cache_ttl, @definitions, @log)
        @thread_udp.start
        @thread_parser.start
end
stop() click to toggle source
# File lib/fluent/plugin/in_netflowipfix.rb, line 61
def stop
                @thread_udp.close
                @thread_udp.join
                @thread_parser.close
                @thread_parser.join
end
tag() click to toggle source
# File lib/fluent/plugin/in_netflowipfix.rb, line 51
def tag
        @tag
end