Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
 public void Dispose()
 {
     connection?.Dispose();
     stack?.Dispose();
     if (options != null)
     {
         foreach (var o in options)
         {
             o.Dispose();
         }
     }
 }
 public void Dispose()
 {
     connection?.Dispose();
     stack?.Dispose();
 }