Ejemplo n.º 1
0
        public void Dispose()
        {
            var cs = Client.ShutdownAsync();
            var ss = Server.ShutdownAsync();

            while (!cs.Wait(5000))
            {
                Console.WriteLine("  *** Waiting for client shutdown call");
            }
            while (!ss.Wait(5000))
            {
                Console.WriteLine("  *** Waiting for server shutdown call");
            }

            var allt = Task.WhenAll(
                cs,
                ss,
                ServerTask,
                ClientTask
                );

            while (!allt.Wait(5000))
            {
                Console.WriteLine(" *** Hung for 5s on shutdown ...");
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Shutdowns the connection.
 /// </summary>
 /// <returns>An awaitable task.</returns>
 public Task ShutdownAsync()
 {
     return(m_connection.ShutdownAsync());
 }