Class: MessagePack::RPC::TCPTransport::BasicSocket
- Inherits:
-
Cool.io::TCPSocket
- Object
- Cool.io::TCPSocket
- MessagePack::RPC::TCPTransport::BasicSocket
- Includes:
- MessageReceiver
- Defined in:
- lib/msgpack/rpc/transport/tcp.rb
Direct Known Subclasses
MessagePack::RPC::TCPClientTransport::ClientSocket, MessagePack::RPC::TCPServerTransport::ServerSocket
Instance Method Summary collapse
-
#initialize(io) ⇒ BasicSocket
constructor
A new instance of BasicSocket.
-
#on_read(data) ⇒ Object
from Cool.io::TCPSocket.
-
#on_readable ⇒ Object
from Cool.io::TCPSocket.
Methods included from MessageReceiver
Constructor Details
#initialize(io) ⇒ BasicSocket
Returns a new instance of BasicSocket.
35 36 37 38 |
# File 'lib/msgpack/rpc/transport/tcp.rb', line 35 def initialize(io) super(io) @pac = MessagePack::Unpacker.new end |
Instance Method Details
#on_read(data) ⇒ Object
from Cool.io::TCPSocket
50 51 52 53 54 |
# File 'lib/msgpack/rpc/transport/tcp.rb', line 50 def on_read(data) @pac.feed_each(data) {|obj| (obj) } end |
#on_readable ⇒ Object
from Cool.io::TCPSocket
41 42 43 44 45 46 47 |
# File 'lib/msgpack/rpc/transport/tcp.rb', line 41 def on_readable super rescue # FIXME send Connection Close message # FIXME log close end |