OBPProtocolHandler class

OverNode Binary Protocol (OBP) Handler

Provides reliable, framed communication over libp2p streams with:

  • Protocol handshaking and version negotiation
  • Reliable message framing and delivery
  • Error handling and recovery
  • Flow control and acknowledgments

Constructors

OBPProtocolHandler.new()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

closeStream(P2PStream stream, {String context = 'unknown'}) Future<void>
Safe stream close with proper cleanup
performHandshake(P2PStream stream, {required bool isClient, Duration timeout = defaultTimeout, String context = 'unknown'}) Future<bool>
Perform protocol handshake
readFrame(P2PStream stream, {Duration timeout = defaultTimeout, String context = 'unknown'}) Future<OBPFrame?>
Read a single frame from stream
resetStream(P2PStream stream, {String context = 'unknown'}) Future<void>
Safe stream reset with proper cleanup
sendError(P2PStream stream, String errorMessage, int errorCode, {Duration timeout = defaultTimeout, String context = 'unknown'}) Future<void>
Send an error response
sendRequest(P2PStream stream, OBPFrame request, {Duration timeout = defaultTimeout, int maxRetries = maxRetries, String context = 'unknown'}) Future<OBPFrame?>
Send a request frame and wait for response
sendResponse(P2PStream stream, OBPFrame response, {Duration timeout = defaultTimeout, String context = 'unknown'}) Future<void>
Send a response frame
writeFrame(P2PStream stream, OBPFrame frame, {Duration timeout = defaultTimeout, String context = 'unknown'}) Future<void>
Write a single frame to stream

Constants

defaultTimeout → const Duration
Default timeout for protocol operations
maxRetries → const int
Maximum number of retry attempts