Class: DEVp2p::WiredService
- Defined in:
- lib/devp2p/wired_service.rb
Overview
A service which has an associated WireProtocol.
peermanager checks all services registered with app.services
if service is instance of WiredService
add WiredService.wire_protocol to announced capabilities
if a peer with the same protocol is connected
a WiredService.wire_protocol instance is created
with instances of Peer and WiredService
WiredService.wire_protocol(Peer.new, WiredService.new)
Direct Known Subclasses
Instance Attribute Summary collapse
-
#wire_protocol ⇒ Object
Returns the value of attribute wire_protocol.
Attributes inherited from Service
Instance Method Summary collapse
Methods inherited from Service
#initialize, register_with_app, #start, #stop, #to_s
Methods included from Configurable
Constructor Details
This class inherits a constructor from DEVp2p::Service
Instance Attribute Details
#wire_protocol ⇒ Object
Returns the value of attribute wire_protocol.
18 19 20 |
# File 'lib/devp2p/wired_service.rb', line 18 def wire_protocol @wire_protocol end |
Instance Method Details
#on_wire_protocol_start(proto) ⇒ Object
20 21 22 |
# File 'lib/devp2p/wired_service.rb', line 20 def on_wire_protocol_start(proto) raise ArgumentError, "argument is not a protocol" unless proto.is_a?(::DEVp2p::Protocol) end |
#on_wire_protocol_stop(proto) ⇒ Object
24 25 26 |
# File 'lib/devp2p/wired_service.rb', line 24 def on_wire_protocol_stop(proto) raise ArgumentError, "argument is not a protocol" unless proto.is_a?(::DEVp2p::Protocol) end |