init method

Future<void> init()

Explicitly initialize the socket; normally you don't have to call it.

Implementation

Future<void> init() async {
  if (_soc != null) return;
  await synchronized(() async {
    if (_soc != null) return;
    _soc = await RawDatagramSocket.bind(InternetAddress.anyIPv4, 0);
  });
}