internal static void OnDisconnect() { bCloseOnPurpose = true; System.Threading.Tasks.Task.Run(async() => { await connection.Close(); }); }