Module: FFWD::Plugin::Protobuf
- Includes:
- Logging, FFWD::Plugin
- Defined in:
- lib/ffwd/plugin/protobuf/version.rb,
lib/ffwd/plugin/protobuf/serializer/protocol0.rb,
lib/ffwd/plugin/protobuf.rb
Defined Under Namespace
Modules: Serializer
Classes: InputUDP, OutputUDP
Constant Summary
collapse
- VERSION =
"0.4.7"
- DEFAULT_HOST =
"localhost"
- DEFAULT_PORT =
19091
- DEFAULT_PROTOCOL =
'udp'
- OUTPUTS =
{:udp => OutputUDP}
- INPUTS =
{:udp => InputUDP}
Class Method Summary
collapse
Class Method Details
120
121
122
123
124
125
126
127
128
129
130
131
132
|
# File 'lib/ffwd/plugin/protobuf.rb', line 120
def self.setup_input config
config[:host] ||= DEFAULT_HOST
config[:port] ||= DEFAULT_PORT
config[:protocol] ||= DEFAULT_PROTOCOL
protocol = FFWD.parse_protocol config[:protocol]
unless connection = INPUTS[protocol.family]
raise "No connection for protocol family: #{protocol.family}"
end
protocol.bind config, log, connection
end
|
.setup_output(config) ⇒ Object
106
107
108
109
110
111
112
113
114
115
116
117
118
|
# File 'lib/ffwd/plugin/protobuf.rb', line 106
def self.setup_output config
config[:host] ||= DEFAULT_HOST
config[:port] ||= DEFAULT_PORT
config[:protocol] ||= DEFAULT_PROTOCOL
protocol = FFWD.parse_protocol config[:protocol]
unless handler = OUTPUTS[protocol.family]
raise "No handler for protocol family: #{protocol.family}"
end
protocol.connect config, log, handler
end
|