tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.11k stars 1.44k forks source link

Optimal timeout for td_receive()? #2325

Closed wowka1319 closed 1 year ago

wowka1319 commented 1 year ago

In python example is 1.0 https://github.com/tdlib/td/blob/master/example/python/tdjson_example.py#L70

In java example is 100000.0 https://github.com/tdlib/td/blob/master/example/java/org/drinkless/tdlib/Client.java#L148

I understand it's easier to control application with smaller value. But despite that is there recommendation?

AYMENJD commented 1 year ago

This is up to you. Timeout must be high enough.

levlam commented 1 year ago

Any big enough value is suitable. If updates are fetched from a dedidated and never terminated thread, then 1e5 is definitely a good value.