openNetworkSocketV4 method
inherited
Opens a side channel to the underlying IPv4 UDP socket. The side channel is used to send/receive raw UDP datagrams on the same socket that the sync protocol uses. This is useful to share the socket between different protocols for hole punching.
Returns None if QUIC IPv4 endpoint isn't bound (see Self::session_bind_network).
Implementation
Future<NetworkSocket?> openNetworkSocketV4(
) async {
final request = RequestSessionOpenNetworkSocketV4(
);
final response = await client.invoke(request);
switch (response) {
case ResponseNetworkSocket(value: final value): return NetworkSocket(client, value);
case ResponseNone(): return null;
default: throw UnexpectedResponse();
}
}