コード例 #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 ...");
            }
        }
コード例 #2
0
ファイル: IPCPeer.cs プロジェクト: kenkendk/LeanIPC
 /// <summary>
 /// Shutdowns the connection.
 /// </summary>
 /// <returns>An awaitable task.</returns>
 public Task ShutdownAsync()
 {
     return(m_connection.ShutdownAsync());
 }