如何取消 Tdlib 中的 Client.send?

huangapple go评论96阅读模式
英文:

How to cancel Client.send in Tdlib?

问题

我正在通过Tdlib编写Telegram认证,发现该库在内部处理重试(例如,当我尝试发送电话号码以开始认证并且连接不稳定/丢失时,库会在内部安排暂停和重试)。

问题是我无法停止它,或者至少无法更改重试策略。如果请求被安排重试,我也不能再次发送相同的请求。

有任何解决这个问题的想法吗?

英文:

I'm writing Telegram authentication via Tdlib and have found that library handles retries internally (e.g. when I'm trying to send phone number to start authentication and connection is poor/missing library would schedule pause-n-retry internally).

The problem is that I can't stop it or at least change retry policy. Neither I was able to send the same request again if it was scheduled for retry.

Any ideas how to get over this?

答案1

得分: -1

看起来答案是发送TdApi.ResendAuthenticationCode。其他可用的重发操作包括:

  • TdApi.ResendChangePhoneNumberCode
  • TdApi.ResendEmailAddressVerificationCode
  • TdApi.ResendMessages
  • TdApi.ResendPhoneNumberConfirmationCode
  • TdApi.ResendPhoneNumberVerificationCode
  • TdApi.ResendRecoveryEmailAddressCode
英文:

So apparently the answer is to send TdApi.ResendAuthenticationCode. Other available resend actions are:

  • TdApi.ResendChangePhoneNumberCode
  • TdApi.ResendEmailAddressVerificationCode
  • TdApi.ResendMessages
  • TdApi.ResendPhoneNumberConfirmationCode
  • TdApi.ResendPhoneNumberVerificationCode
  • TdApi.ResendRecoveryEmailAddressCode

huangapple
  • 本文由 发表于 2020年7月23日 20:34:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/63054387.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定