Good day. Tell me, please, how can I implement long pulling to VKontakte servers in C #? Now I use a recursive call to an asynchronous method, but this creates certain bugs in the application.
private async Task GetUpdatesFromServer() { await Task.Run(async () => { string url = $"какой-то урл"; using (var http = new HttpClient()) { var json = await http.GetStringAsync(url); var updates = JsonConvert.DeserializeObject<LongPollUpdates>(json); Ts = updates.Ts; if (updates.Updates.Count > 0) { await SendUpdate.Invoke(updates.Updates); } } await GetUpdatesFromServer(); }); }
while? - VladDSendUpdatetype? What doesInvokedo? - VladD