gpt4 book ai didi

ios - 如何使用 XMPPFramework 设置邀请请求连接超时?

转载 作者:行者123 更新时间:2023-12-01 20:08:12 25 4
gpt4 key购买 nike

如何在 XMPP 中设置超时?据我搜索,我发现有两个超时。

  1. Timeout during which App tries to make connection with Server. This timeout is configurable:

[_xmppStream connectWithTimeout:kTimeOutForChat error:&error]

  1. Timeout at which XMPPStream checks for invitation approval/Decline after connection with Spark is in Library File.


我正在寻找允许我在不修改库的情况下配置第二次超时的解决方案。
 FileName : XMPPStream.m
#define TIMEOUT_XMPP_READ_STREAM -1

我想要这个 -140 .我不想编辑库文件。有什么方法可以在不修改库的情况下进行设置?

编辑:代码接近超时宏
  /**
* Seeing a return statements within an inner block
* can sometimes be mistaken for a return point of the enclosing method.
* This makes inline blocks a bit easier to read.
**/
#define return_from_block return

// Define the timeouts (in seconds) for retreiving various parts of the XML stream
#define TIMEOUT_XMPP_WRITE -1
#define TIMEOUT_XMPP_READ_START 10
#define TIMEOUT_XMPP_READ_STREAM 40

// Define the tags we'll use to differentiate what it is we're currently reading or writing
#define TAG_XMPP_READ_START 100
#define TAG_XMPP_READ_STREAM 101
#define TAG_XMPP_WRITE_START 200
#define TAG_XMPP_WRITE_STOP 201
#define TAG_XMPP_WRITE_STREAM 202
#define TAG_XMPP_WRITE_RECEIPT 203

// Define the timeouts (in seconds) for SRV

最佳答案

如果代码有 #ifdef要检查定义是否已经存在,那么您可以使用预处理器来定义您想要的值。但是,它没有,所以我想不出一个简单的方法是使用预处理器来替换它并保持它可编译。

最简单的解决方案就是 fork 项目并保持一个小的变化。这应该是一种低成本的解决方案,因为您的更改将仅限于一条线,并且合并上游更改应该(通常)是自动的。

关于ios - 如何使用 XMPPFramework 设置邀请请求连接超时?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38282082/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com