void ConnectionStateHandler(NWConnectionState state, NWError error) { switch (state) { case NWConnectionState.Ready: connectedEvent.Set(); break; case NWConnectionState.Cancelled: connection?.Dispose(); connection = null; stack?.Dispose(); stack = null; foreach (var o in options) { o.Dispose(); } break; case NWConnectionState.Invalid: case NWConnectionState.Failed: Assert.Inconclusive("Network connection could not be performed."); break; } }
void ConnectionStateHandler(NWConnectionState state, NWError error) { switch (state) { case NWConnectionState.Ready: connectedEvent.Set(); break; case NWConnectionState.Invalid: case NWConnectionState.Failed: Assert.Inconclusive("Network connection could not be performed."); break; } }
void ConnectionStateHandler(NWConnectionState state, NWError error) { Console.WriteLine($"State is {state} and error {error}"); switch (state) { case NWConnectionState.Ready: connectedEvent.Set(); break; case NWConnectionState.Cancelled: connection?.Dispose(); connection = null; foreach (var i in interfaces) { i.Dispose(); } break; case NWConnectionState.Invalid: case NWConnectionState.Failed: Assert.Inconclusive("Network connection could not be performed."); break; } }