Class: Ciri::P2P::Protocol
- Inherits:
-
Object
- Object
- Ciri::P2P::Protocol
- Includes:
- Utils::Logger
- Defined in:
- lib/ciri/p2p/protocol.rb
Overview
protocol represent P2P sub protocols
Instance Attribute Summary collapse
-
#length ⇒ Object
readonly
Returns the value of attribute length.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #connected(context) ⇒ Object
- #disconnected(context) ⇒ Object
-
#initialize(name:, version:, length:) ⇒ Protocol
constructor
A new instance of Protocol.
- #initialized(context) ⇒ Object
- #received(context, data) ⇒ Object
Constructor Details
#initialize(name:, version:, length:) ⇒ Protocol
Returns a new instance of Protocol.
37 38 39 40 41 |
# File 'lib/ciri/p2p/protocol.rb', line 37 def initialize(name:, version:, length:) @name = name @version = version @length = length end |
Instance Attribute Details
#length ⇒ Object (readonly)
Returns the value of attribute length.
35 36 37 |
# File 'lib/ciri/p2p/protocol.rb', line 35 def length @length end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
35 36 37 |
# File 'lib/ciri/p2p/protocol.rb', line 35 def name @name end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
35 36 37 |
# File 'lib/ciri/p2p/protocol.rb', line 35 def version @version end |
Instance Method Details
#connected(context) ⇒ Object
51 52 53 |
# File 'lib/ciri/p2p/protocol.rb', line 51 def connected(context) debug("not implemented Protocol#connected callback") end |
#disconnected(context) ⇒ Object
55 56 57 |
# File 'lib/ciri/p2p/protocol.rb', line 55 def disconnected(context) debug("not implemented Protocol#disconnected callback") end |
#initialized(context) ⇒ Object
43 44 45 |
# File 'lib/ciri/p2p/protocol.rb', line 43 def initialized(context) debug("not implemented Protocol#initialized callback") end |
#received(context, data) ⇒ Object
47 48 49 |
# File 'lib/ciri/p2p/protocol.rb', line 47 def received(context, data) debug("not implemented Protocol#received callback") end |