tgbot-cpp icon indicating copy to clipboard operation
tgbot-cpp copied to clipboard

Question about polling

Open SZOKOZ opened this issue 3 years ago • 1 comments

I need my bot to respond to events and while I can do that inside the long poll loop, the poll itself takes a bit of time before it returns. Is there a way to set the timeout or is there a short poll equivalent, etc?

SZOKOZ avatar Dec 17 '21 22:12 SZOKOZ

  1. look at the TgLongPoll declaration to set up upper limit https://github.com/reo7sp/tgbot-cpp/blob/f2d7dc110d3ba37914298bd073500396fcf93967/src/net/TgLongPoll.cpp

  2. check network latency from your machine to TG API endpoint

  3. measure time not from app start, but from longpoll start, so you will see how many ms being spent for app load on top of network latency and longpoll spin-up delay

mrXCray avatar Jul 18 '22 10:07 mrXCray