private static async Task ConnectSingle() { var connection = CreateConnection(); try { if (Arguments.Transport == null) { await connection.Start(); } else { await connection.Start(Arguments.GetTransport()); } connection.Closed += () => { Connections.TryTake(out connection); }; Connections.Add(connection); } catch (Exception e) { Console.WriteLine("Connection.Start Failed: {0}: {1}", e.GetType(), e.Message); } }