Class: MessagePack::RPC::UDPServerTransport::ServerSocket
- Inherits:
-
MessagePack::RPC::UDPTransport::BasicSocket
- Object
- Cool.io::IOWatcher
- MessagePack::RPC::UDPTransport::BasicSocket
- MessagePack::RPC::UDPServerTransport::ServerSocket
- Defined in:
- lib/msgpack/rpc/transport/udp.rb
Constant Summary
Constants inherited from MessagePack::RPC::UDPTransport::BasicSocket
MessagePack::RPC::UDPTransport::BasicSocket::HAVE_DNRL
Instance Attribute Summary
Attributes inherited from MessagePack::RPC::UDPTransport::BasicSocket
Instance Method Summary collapse
-
#initialize(io, server) ⇒ ServerSocket
constructor
A new instance of ServerSocket.
-
#on_notify(method, param, addr) ⇒ Object
MessageReceiver interface.
-
#on_request(msgid, method, param, addr) ⇒ Object
MessageReceiver interface.
-
#on_response(msgid, error, result, addr) ⇒ Object
MessageReceiver interface.
Methods inherited from MessagePack::RPC::UDPTransport::BasicSocket
Methods included from MessageReceiver
Constructor Details
#initialize(io, server) ⇒ ServerSocket
Returns a new instance of ServerSocket.
160 161 162 163 |
# File 'lib/msgpack/rpc/transport/udp.rb', line 160 def initialize(io, server) super(io) @server = server end |
Instance Method Details
#on_notify(method, param, addr) ⇒ Object
MessageReceiver interface
172 173 174 |
# File 'lib/msgpack/rpc/transport/udp.rb', line 172 def on_notify(method, param, addr) @server.on_notify(method, param) end |
#on_request(msgid, method, param, addr) ⇒ Object
MessageReceiver interface
166 167 168 169 |
# File 'lib/msgpack/rpc/transport/udp.rb', line 166 def on_request(msgid, method, param, addr) sender = ResponseSender.new(@io, addr[3], addr[1]) @server.on_request(sender, msgid, method, param) end |
#on_response(msgid, error, result, addr) ⇒ Object
MessageReceiver interface
177 178 179 |
# File 'lib/msgpack/rpc/transport/udp.rb', line 177 def on_response(msgid, error, result, addr) raise Error.new("response message on server session") end |