Class: MessagePack::RPC::UDPClientTransport::ClientSocket
- Inherits:
-
MessagePack::RPC::UDPTransport::BasicSocket
- Object
- Cool.io::IOWatcher
- MessagePack::RPC::UDPTransport::BasicSocket
- MessagePack::RPC::UDPClientTransport::ClientSocket
- 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, session) ⇒ ClientSocket
constructor
A new instance of ClientSocket.
-
#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.
-
#send_data(data) ⇒ Object
MessageSendable interface.
Methods inherited from MessagePack::RPC::UDPTransport::BasicSocket
Methods included from MessageReceiver
Constructor Details
#initialize(io, session) ⇒ ClientSocket
Returns a new instance of ClientSocket.
95 96 97 98 |
# File 'lib/msgpack/rpc/transport/udp.rb', line 95 def initialize(io, session) super(io) @s = session end |
Instance Method Details
#on_notify(method, param, addr) ⇒ Object
MessageReceiver interface
111 112 113 |
# File 'lib/msgpack/rpc/transport/udp.rb', line 111 def on_notify(method, param, addr) raise Error.new("notify message on client session") end |
#on_request(msgid, method, param, addr) ⇒ Object
MessageReceiver interface
106 107 108 |
# File 'lib/msgpack/rpc/transport/udp.rb', line 106 def on_request(msgid, method, param, addr) raise Error.new("request message on client session") end |
#on_response(msgid, error, result, addr) ⇒ Object
MessageReceiver interface
116 117 118 |
# File 'lib/msgpack/rpc/transport/udp.rb', line 116 def on_response(msgid, error, result, addr) @s.on_response(self, msgid, error, result) end |
#send_data(data) ⇒ Object
MessageSendable interface
101 102 103 |
# File 'lib/msgpack/rpc/transport/udp.rb', line 101 def send_data(data) @io.send(data, 0) end |