Class: MessagePack::RPC::TCPClientTransport::ClientSocket
- Inherits:
-
MessagePack::RPC::TCPTransport::BasicSocket
- Object
- Cool.io::TCPSocket
- MessagePack::RPC::TCPTransport::BasicSocket
- MessagePack::RPC::TCPClientTransport::ClientSocket
- Defined in:
- lib/msgpack/rpc/transport/tcp.rb
Instance Method Summary collapse
-
#initialize(io, transport, session) ⇒ ClientSocket
constructor
A new instance of ClientSocket.
-
#on_close ⇒ Object
from Cool.io::TCPSocket.
-
#on_connect ⇒ Object
from Cool.io::TCPSocket.
-
#on_connect_failed ⇒ Object
from Cool.io::TCPSocket.
-
#on_notify(method, param) ⇒ Object
MessageReceiver interface.
-
#on_request(msgid, method, param) ⇒ Object
MessageReceiver interface.
-
#on_response(msgid, error, result) ⇒ Object
MessageReceiver interface.
-
#send_data(data) ⇒ Object
MessageSendable interface.
-
#send_pending(data) ⇒ Object
from TCPClientTransport::on_connect.
Methods inherited from MessagePack::RPC::TCPTransport::BasicSocket
Methods included from MessageReceiver
Constructor Details
#initialize(io, transport, session) ⇒ ClientSocket
Returns a new instance of ClientSocket.
134 135 136 137 138 |
# File 'lib/msgpack/rpc/transport/tcp.rb', line 134 def initialize(io, transport, session) super(io) @t = transport @s = session end |
Instance Method Details
#on_close ⇒ Object
from Cool.io::TCPSocket
180 181 182 183 184 185 186 187 |
# File 'lib/msgpack/rpc/transport/tcp.rb', line 180 def on_close return unless @t @t.on_close(self) @t = nil @s = nil rescue nil end |
#on_connect ⇒ Object
from Cool.io::TCPSocket
166 167 168 169 |
# File 'lib/msgpack/rpc/transport/tcp.rb', line 166 def on_connect return unless @t @t.on_connect(self) end |
#on_connect_failed ⇒ Object
from Cool.io::TCPSocket
172 173 174 175 176 177 |
# File 'lib/msgpack/rpc/transport/tcp.rb', line 172 def on_connect_failed return unless @t @t.on_connect_failed(self) rescue nil end |
#on_notify(method, param) ⇒ Object
MessageReceiver interface
156 157 158 |
# File 'lib/msgpack/rpc/transport/tcp.rb', line 156 def on_notify(method, param) raise Error.new("notify message on client session") end |
#on_request(msgid, method, param) ⇒ Object
MessageReceiver interface
151 152 153 |
# File 'lib/msgpack/rpc/transport/tcp.rb', line 151 def on_request(msgid, method, param) raise Error.new("request message on client session") end |
#on_response(msgid, error, result) ⇒ Object
MessageReceiver interface
161 162 163 |
# File 'lib/msgpack/rpc/transport/tcp.rb', line 161 def on_response(msgid, error, result) @s.on_response(self, msgid, error, result) end |
#send_data(data) ⇒ Object
MessageSendable interface
141 142 143 |
# File 'lib/msgpack/rpc/transport/tcp.rb', line 141 def send_data(data) write data end |
#send_pending(data) ⇒ Object
from TCPClientTransport::on_connect
146 147 148 |
# File 'lib/msgpack/rpc/transport/tcp.rb', line 146 def send_pending(data) write data end |