-
Notifications
You must be signed in to change notification settings - Fork 99
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
当数据量大的时候会出现异常现象,主要是获取body的length #8
Comments
I also have met the same problem,any solution? |
数据量有多大呢? 超出了服务端设置的4个字节的最大长度吗 |
比如利用压测工具每秒500的并发量就有问题,初步判断是socket粘包,目前demo的逻辑应该是有问题的,心跳数据也会同message数据合在一起的
… On 22 Jan 2018, at 3:35 PM, Fight0913 ***@***.***> wrote:
数据量有多大呢? 超出了服务端设置的4个字节的最大长度吗
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#8 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AE3Vnr3UHYIam6y0w5Yzebi3SVffbvU8ks5tNDpYgaJpZM4RDSaD>.
|
粘包问题已经处理过的,我用数据量较大的消息测过的,你这个问题应该不是这个问题,心跳数据也会同message数据合在一起的只是和你所了解的方式不同罢了
原始邮件
发件人:[email protected]
收件人:mpusher/[email protected]
抄送:[email protected]; [email protected]
发送时间:2018年1月29日(周一) 13:57
主题:Re: [mpusher/mpush-client-oc] 当数据量大的时候会出现异常现象,主要是获取body的length (#8)
比如利用压测工具每秒500的并发量就有问题,初步判断是socket粘包,目前demo的逻辑应该是有问题的,心跳数据也会同message数据合在一起的
On 22 Jan 2018, at 3:35 PM, Fight0913 [email protected] wrote:
数据量有多大呢? 超出了服务端设置的4个字节的最大长度吗
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub ,">#8 (comment), or mute the thread .">https://github.com/notifications/unsubscribe-auth/AE3Vnr3UHYIam6y0w5Yzebi3SVffbvU8ks5tNDpYgaJpZM4RDSaD.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
最新的Demo也是会出现这个问题的,在socket接收方法里面定位到data偶然会出现data.length == 2的情况(data.length == 1代表心跳),另外一个问题是大量数据压测,可能会出现doule free的情况,但是如果将接受到的数据处理过程全部放在主线程中,就可以避免。 |
data.length == 2的数据能解析出来吗? 可以看下协议头里的length的数值多少,两个比较一下,就知道是半包 还是 粘包问题了
原始邮件
发件人:[email protected]
收件人:mpusher/[email protected]
抄送:[email protected]; [email protected]
发送时间:2018年4月24日(周二) 19:26
主题:Re: [mpusher/mpush-client-oc] 当数据量大的时候会出现异常现象,主要是获取body的length (#8)
最新的Demo也是会出现这个问题的,在socket接收方法里面定位到data偶然会出现data.length == 2的情况(data.length == 1代表心跳),另外一个问题是大量数据压测,可能会出现doule free的情况,但是如果将接受到的数据处理过程全部放在主线程中,就可以避免。
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
数据解析不来,就是突然会出现data长度为2,这个时候直接导致崩溃,只能对这个进行特殊处理,把data.length==2的直接过滤,把他也当成心跳包这样子的无用数据。 |
你给我这些信息,我怎么能帮你解决问题呢,要么加我QQ我连你们的服务,调试一下,要么你给我更具体的信息
原始邮件
发件人:[email protected]
收件人:mpusher/[email protected]
抄送:[email protected]; [email protected]
发送时间:2018年4月27日(周五) 17:10
主题:Re: [mpusher/mpush-client-oc] 当数据量大的时候会出现异常现象,主要是获取body的length (#8)
数据解析不来,就是突然会出现data长度为2,这个时候直接导致崩溃,只能对这个进行特殊处理,把data.length==2的直接过滤,把他也当成心跳包这样子的无用数据。
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NSData *lengthData = [MessageDataPacketTool getsubdata:data withRange:NSMakeRange(0, 4)];
很明显这个length应该是错误的,也不清楚是什么原因
The text was updated successfully, but these errors were encountered: