send method

void send(
  1. Uint8List data
)

Send data on a new unidirectional stream.

Opens a client-initiated unidirectional stream via the underlying connection. In a full implementation the data would be written to the stream and packetized; the current design stores it in the stream manager for later transmission.

Implementation

void send(Uint8List data) {
  final conn = _quicConnection as dynamic;
  try {
    // Attempt to open a unidirectional stream and send data.
    conn.openUnidirectionalStream();
    // Note: In a full implementation this would write the data to the
    // stream via the connection's packet builder. The current design
    // stores data in the stream manager for later packetization.
  } catch (_) {
    // If the connection doesn't support unidirectional streams,
    // the data cannot be sent.
  }
}