Class: Ciri::P2P::Protocol

Inherits:
Object
  • Object
show all
Includes:
Utils::Logger
Defined in:
lib/ciri/p2p/protocol.rb

Overview

protocol represent P2P sub protocols

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#lengthObject (readonly)

Returns the value of attribute length.



35
36
37
# File 'lib/ciri/p2p/protocol.rb', line 35

def length
  @length
end

#nameObject (readonly)

Returns the value of attribute name.



35
36
37
# File 'lib/ciri/p2p/protocol.rb', line 35

def name
  @name
end

#versionObject (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