sendResponse static method
Send a response frame
Used by servers to respond to client requests.
Implementation
static Future<void> sendResponse(
core_p2p_stream.P2PStream stream,
OBPFrame response, {
Duration timeout = defaultTimeout,
String context = 'unknown',
}) async {
try {
_logger.fine('[$context] Sending response: ${response.type}');
await _writeFrame(stream, response, timeout: timeout, context: context);
_logger.fine('[$context] Response sent successfully');
} catch (e, stackTrace) {
_logger.severe('[$context] Failed to send response: $e', e, stackTrace);
rethrow;
}
}