ZLMediaKit / ZLToolKit

一个基于C++11的轻量级网络框架,基于线程池技术可以实现大并发网络IO
MIT License
1.98k stars 588 forks source link

iOS 16 and above, socket_ios will definitely crash, urgent, please help me take a look. #176

Closed dongdan002 closed 1 year ago

dongdan002 commented 1 year ago

When using a network library on iOS, after a TCP socket connection is successful, a crash occurs when setting setSocketOfiOS at the iOS layer.

The crash occurs on this line:

BOOL r1 = CFReadStreamOpen((CFReadStreamRef)readStream);
setSocketOfiOS(int)
setConnected()

在ios上使用网络库,tcpsocket连接成功后,在ios层设置setSocketOfiOS时,必现崩溃 崩在了这一行: BOOL r1 = CFReadStreamOpen((CFReadStreamRef)readStream); setSocketOfiOS(int) setConnected()

TRANS_BY_GITHUB_AI_ASSISTANT

xia-chu commented 1 year ago

Is there a crash stack? Which specific line of code? Can you take a screenshot?

有崩溃堆栈不?具体哪句代码?截图看下

TRANS_BY_GITHUB_AI_ASSISTANT

dongdan002 commented 1 year ago

image

dongdan002 commented 1 year ago

image

dongdan002 commented 1 year ago

The screenshot has been sent.

截图已经发了

TRANS_BY_GITHUB_AI_ASSISTANT

dongdan002 commented 1 year ago

The screenshot has been sent.

截图已经发了

TRANS_BY_GITHUB_AI_ASSISTANT

dongdan002 commented 1 year ago

有崩溃堆栈不?具体哪句代码?截图看下

Are the setSocketOfIOS and unsetSocketOfIOS interfaces necessary? I don't see any other files using the readStream and writeStream objects.

有崩溃堆栈不?具体哪句代码?截图看下

setSocketOfIOS 和 unsetSocketOfIOS 这两个接口是必须的吗?我看其他文件里也没有用到 readStream和writeStream这两个对象。

TRANS_BY_GITHUB_AI_ASSISTANT

xia-chu commented 1 year ago

It's not necessary. You can comment it out. I plan to delete the related code later.

This code marks the socket as a VOIP type.

不是必须的 你注释掉吧 后面打算删除相关代码

这个代码是把socket标记为voip类型的

TRANS_BY_GITHUB_AI_ASSISTANT

dongdan002 commented 1 year ago

不是必须的 你注释掉吧 后面打算删除相关代码

这个代码是把socket标记为voip类型的

Okay, thanks, I'll try.

不是必须的 你注释掉吧 后面打算删除相关代码

这个代码是把socket标记为voip类型的

好的,多谢,我试一下

TRANS_BY_GITHUB_AI_ASSISTANT

dongdan002 commented 1 year ago

Commented out the logic in socket_ios.mm to restore it to normal. Thanks to Xia for helping to troubleshoot.

注掉socket_ios.mm里的逻辑恢复正常,感谢夏工帮忙排查。

TRANS_BY_GITHUB_AI_ASSISTANT