onCapsuleReceived method

void onCapsuleReceived(
  1. int sessionId,
  2. Capsule capsule
)

Process an incoming capsule belonging to sessionId.

Implementation

void onCapsuleReceived(int sessionId, Capsule capsule) {
  final session = _webTransportSessions[sessionId];
  if (session != null) {
    session.onCapsule(capsule);
  }
  if (capsule is CloseWebTransportSessionCapsule) {
    _webTransportSessions.remove(sessionId);
  }
}