Module: Plug::UdpServer

Includes:
Base
Defined in:
lib/rbkb/plug/plug.rb

Overview

An abstract module to implement custom servers for any protocol incoming messages are diverted to 'process(dat, sender)' which takes a block, the yields to which are messages to respond with

Instance Attribute Summary

Attributes included from Base

#no_stop_on_unbind, #peers, #tls, #tls_opts, #transport

Instance Method Summary collapse

Methods included from Base

#connection_completed, #initialize, #name, #plug_peer, #plug_receive, #post_init, #receive_data, #unbind

Instance Method Details

#kind ⇒ Object



140
141
142
# File 'lib/rbkb/plug/plug.rb', line 140

def kind
  :server
end

#say(dat, sender) ⇒ Object



144
145
146
147
148
# File 'lib/rbkb/plug/plug.rb', line 144

def say(dat, sender)
  super(dat, sender)

  send(:process, dat, sender) { |rply| sender.say(rply, self) } if respond_to? :process
end