reset method

Future<void> reset()

Resets all the sockets.

When working with localhost, even UDP sockets can throw errors when the remote is unreachable. Resetting the sockets will bypass these errors.

Implementation

Future<void> reset() async {
  for (final socket in sockets) {
    await socket.dispose();
    await socket.init();
  }
  // Sockets lose their destination when disposed, so we restore it.
  await updateSockets();
}