Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

m_iPending断言触发 #260

Open
woowloop opened this issue Jun 27, 2023 · 6 comments
Open

m_iPending断言触发 #260

woowloop opened this issue Jun 27, 2023 · 6 comments

Comments

@woowloop
Copy link

woowloop commented Jun 27, 2023

在EnHandleResult OnReceive(CONNID dwConnID, const BYTE* pData, int iLength)函数中返回HR_ERROR 偶尔会触发m_iPending>=0
image

@ldcsaa
Copy link
Owner

ldcsaa commented Jul 2, 2023

理论上 m_iPending 不可能小于0的,你再调试下看看工作线程堆栈和变量值。

@woowloop
Copy link
Author

woowloop commented Jul 4, 2023

image
image

@ldcsaa
Copy link
Owner

ldcsaa commented Jul 6, 2023

目前能想到的唯一一个小于0的可能就是int值超出最大值了,不过那要2g数据,不大可能。
要不修改m_iPending的地方的下一行代码打个条件断点,当m_iPending小于0时触发断点。

@woowloop
Copy link
Author

woowloop commented Jul 31, 2023

直接修改了了TcpClinet.cpp文件在修改m_iPending的地方都加了断言 重新编译测试数据确实超过2g了
image
2147570277超过了2147483647

@FunlyDay
Copy link

FunlyDay commented Jul 31, 2023 via email

@ldcsaa
Copy link
Owner

ldcsaa commented Aug 5, 2023

重新编译测试数据确实超过2g了

要么是发送太快,需要做下流控。要么是调用send时传入的length不正确。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants