I think there should be a better way than Task.Run and Thread.Sleep(20ms).    Isn't a better way to flush Connection w/o this hack?