默认
发表评论 7
想开发IM:买成品怕坑?租第3方怕贵?找开源自已撸?尽量别走弯路了... 找站长给点建议
[已回复] 求助MobileIMSDK4iLib iOS发送消息内容过长报 301 问题
阅读(50620) | 评论(7 收藏 淘帖1
1.集成的这个地址https://gitee.com/jackjiang/MobileIMSDK 地址里的SDK
2.正常登陆后使用该方法发送消息
[color=rgba(65, 182, 69, 0.45)]/*!
* 通用数据发送方法(默认不需要Qos支持)。
[color=rgba(65, 182, 69, 0.45)] *
* @param dataContentWidthStr 要发送的数据内容(字符串方式组织)
* @param to_user_id 要发送到的目标用户id
* @param QoS true表示需QoS机制支持,不则不需要
* @param fingerPrint QoS机制中要用到的指纹码(即消息包唯一id),生成方法见 [Protocal:genFingerPrint]
* @return 0表示数据发出成功,否则返回的是错误码
* @see [sendCommonDatarotocal]
* @see [DataFactoryC:createCommonData(String, int, int, boolean, String)]
[color=rgba(65, 182, 69, 0.45)] */
- (int) sendCommonDataWithStrNSString *)dataContentWidthStr toUserIdNSString *)to_user_id qosBOOL)QoS fpNSString *)fingerPrint withTypeuint)typeu;


3.当dataContentWidthStr消息数据内容过多时 ,报 301 用户未登录 报错误的是这个协议方法
[color=rgba(65, 182, 69, 0.45)]/*!
* 服务端反馈的出错信息回调事件通知。
[color=rgba(65, 182, 69, 0.45)] *
* @param errorCode 错误码,定义在常量表 ErrorCode 中有关服务端错误码的定义
* @param errorMsg 描述错误内容的文本信息
* @see ErrorCode
[color=rgba(65, 182, 69, 0.45)] */
- (void) onErrorResponseint)errorCode withErrorMsgNSString*)errorMsg;


麻烦站长给予解惑,谢谢了

即时通讯网 - 即时通讯开发者社区! 来源: - 即时通讯开发者社区!

标签:MobileIMSDK
上一篇:[已解决]MobileIMSDK iOS 无法打包问题:“bitcode bundle could not be generated”下一篇:[已回复]建议MobileIMSDK的ACK消息新增额外字段、取消json依赖、dataContent改byte[]

本帖已收录至以下技术专辑

推荐方案
评论 7
你发的这个内容大概有多长?(具体的字节数)
用的是tcp协议吗?

另外:当这个异常出现时,服务端也会出现完整异常,你把log抓出来,我帮你看看
引用:JackJiang 发表于 2020-12-11 11:51
你发的这个内容大概有多长?(具体的字节数)
用的是tcp协议吗?

1.字节数是1024(备注:我想做图片传输,就把图片转成了NSData然后把Data转成了Base-64编码的字符串所以内容就多了 )
2.协议用的是udp
3.下面是服务端log日志
2020-12-11 13:12:48.490 [defaultEventLoopGroup-5-1] INFO  net.openmob.mobileimsdk.server.ServerCoreHandler:310 - [IMCORE-netty]{uid:182}/116.68.223.158:52933的会话已关闭(user_id=182)了...
2020-12-11 13:12:48.490 [defaultEventLoopGroup-5-1] INFO  net.openmob.mobileimsdk.server.ServerCoreHandler:315 - .......... 【0】[当前正在被关闭的session] session.hashCode=-1025860775, session.ip+port=/116.68.223.158:52933
2020-12-11 13:12:48.490 [defaultEventLoopGroup-5-1] INFO  net.openmob.mobileimsdk.server.ServerCoreHandler:320 - .......... 【1】[处于在线列表中的session] session.hashCode=-1025860775, session.ip+port=/116.68.223.158:52933
2020-12-11 13:12:52.500 [defaultEventLoopGroup-5-2] INFO  net.openmob.mobileimsdk.server.ServerCoreHandler:380 - [IMCORE-netty]与{uid:null}/116.68.223.158:52933的会话建立(channelActive)了...
2020-12-11 13:12:52.501 [defaultEventLoopGroup-5-2] WARN  net.openmob.mobileimsdk.server.ServerCoreHandler:328 - [IMCORE-netty]>> 客户端{uid:null}/116.68.223.158:52933尚未登陆,{

}处理未继续.
2020-12-11 13:12:54.529 [defaultEventLoopGroup-5-2] INFO  n.o.mobileimsdk.server.processor.LogicProcessor:236 - [IMCORE]>> 客户端{uid:null}/116.68.223.158:52933发过来的登陆信息内容是:loginInfo=182|getToken=a980f28ce67e52e4
2020-12-11 13:12:54.545 [defaultEventLoopGroup-5-2] INFO  net.openmob.mobileimsdk.server.ServerCoreHandler:193 - [IMCORE-netty]<< 收到客户端{uid:182}/116.68.223.158:52933的ACK应答包发送请求.
2020-12-11 13:12:54.545 [defaultEventLoopGroup-5-2] WARN  n.o.mobileimsdk.server.qos.QoS4SendDaemonRoot:408 - 【IMCORE-netty-本机QoS】【QoS发送方】指纹为8cc7c871-0ae3-446f-b491-f013d8ad31f1的消息已成功从发送质量保证队列中移除(可能是收到接收方的应答也可能是达到了重传的次数上限),重试次数=0
2020-12-11 13:12:54.560 [defaultEventLoopGroup-5-2] INFO  net.openmob.mobileimsdk.server.ServerCoreHandler:310 - [IMCORE-netty]{uid:182}/116.68.223.158:52933的会话已关闭(user_id=182)了...
2020-12-11 13:12:54.560 [defaultEventLoopGroup-5-2] INFO  net.openmob.mobileimsdk.server.ServerCoreHandler:315 - .......... 【0】[当前正在被关闭的session] session.hashCode=1700276966, session.ip+port=/116.68.223.158:52933
2020-12-11 13:12:54.560 [defaultEventLoopGroup-5-2] INFO  net.openmob.mobileimsdk.server.ServerCoreHandler:320 - .......... 【1】[处于在线列表中的session] session.hashCode=1700276966, session.ip+port=/116.68.223.158:52933
2020-12-11 13:13:00.489 [defaultEventLoopGroup-5-1] INFO  net.openmob.mobileimsdk.server.ServerCoreHandler:380 - [IMCORE-netty]与{uid:null}/116.68.223.158:52933的会话建立(channelActive)了...
2020-12-11 13:13:00.489 [defaultEventLoopGroup-5-1] WARN  net.openmob.mobileimsdk.server.ServerCoreHandler:328 - [IMCORE-netty]>> 客户端{uid:null}/116.68.223.158:52933尚未登陆,{

}处理未继续.
2020-12-11 13:13:00.491 [defaultEventLoopGroup-5-1] WARN  net.openmob.mobileimsdk.server.ServerCoreHandler:362 - [IMCORE-netty]【注意】会话{uid:null}/116.68.223.158:52933被系统close了,但它里面没有存放user_id,它很可能是没有成功合法认证而被提前关闭,从而正常释放资源。
2020-12-11 13:13:03.489 [defaultEventLoopGroup-5-2] INFO  net.openmob.mobileimsdk.server.ServerCoreHandler:380 - [IMCORE-netty]与{uid:null}/116.68.223.158:52933的会话建立(channelActive)了...
2020-12-11 13:13:03.489 [defaultEventLoopGroup-5-2] WARN  net.openmob.mobileimsdk.server.ServerCoreHandler:328 - [IMCORE-netty]>> 客户端{uid:null}/116.68.223.158:52933尚未登陆,{

}处理未继续.
2020-12-11 13:13:03.491 [defaultEventLoopGroup-5-2] INFO  n.o.mobileimsdk.server.processor.LogicProcessor:236 - [IMCORE]>> 客户端{uid:null}/116.68.223.158:52933发过来的登陆信息内容是:loginInfo=182|getToken=a980f28ce67e52e4
2020-12-11 13:13:03.561 [defaultEventLoopGroup-5-2] INFO  net.openmob.mobileimsdk.server.ServerCoreHandler:193 - [IMCORE-netty]<< 收到客户端{uid:182}/116.68.223.158:52933的ACK应答包发送请求.
2020-12-11 13:13:03.561 [defaultEventLoopGroup-5-2] WARN  n.o.mobileimsdk.server.qos.QoS4SendDaemonRoot:408 - 【IMCORE-netty-本机QoS】【QoS发送方】指纹为865aecf1-283a-41da-8680-01cc95f56b0d的消息已成功从发送质量保证队列中移除(可能是收到接收方的应答也可能是达到了重传的次数上限),重试次数=0
2020-12-11 13:13:52.573 [defaultEventLoopGroup-5-2] INFO  net.openmob.mobileimsdk.server.ServerCoreHandler:310 - [IMCORE-netty]{uid:182}/116.68.223.158:52933的会话已关闭(user_id=182)了...
2020-12-11 13:13:52.574 [defaultEventLoopGroup-5-2] INFO  net.openmob.mobileimsdk.server.ServerCoreHandler:315 - .......... 【0】[当前正在被关闭的session] session.hashCode=-1406297199, session.ip+port=/116.68.223.158:52933
2020-12-11 13:13:52.574 [defaultEventLoopGroup-5-2] INFO  net.openmob.mobileimsdk.server.ServerCoreHandler:320 - .......... 【1】[处于在线列表中的session] session.hashCode=-1406297199, session.ip+port=/116.68.223.158:52933
2020-12-11 13:13:56.489 [defaultEventLoopGroup-5-1] INFO  net.openmob.mobileimsdk.server.ServerCoreHandler:380 - [IMCORE-netty]与{uid:null}/116.68.223.158:58358的会话建立(channelActive)了...
2020-12-11 13:13:56.489 [defaultEventLoopGroup-5-1] INFO  n.o.mobileimsdk.server.processor.LogicProcessor:236 - [IMCORE]>> 客户端{uid:null}/116.68.223.158:58358发过来的登陆信息内容是:loginInfo=182|getToken=a980f28ce67e52e4
2020-12-11 13:13:56.491 [Timer-1] WARN  n.o.mobileimsdk.server.qos.QoS4SendDaemonRoot:189 - 【IMCORE-netty-本机QoS】【QoS发送方】指纹为42af0673-c293-47fa-a7f9-d670584b510f的包距"刚刚"发出才2ms(<=2000ms将被认定是"刚刚"), 本次不需要重传哦.
2020-12-11 13:13:56.593 [defaultEventLoopGroup-5-1] INFO  net.openmob.mobileimsdk.server.ServerCoreHandler:193 - [IMCORE-netty]<< 收到客户端{uid:182}/116.68.223.158:58358的ACK应答包发送请求.
2020-12-11 13:13:56.593 [defaultEventLoopGroup-5-1] WARN  n.o.mobileimsdk.server.qos.QoS4SendDaemonRoot:408 - 【IMCORE-netty-本机QoS】【QoS发送方】指纹为42af0673-c293-47fa-a7f9-d670584b510f的消息已成功从发送质量保证队列中移除(可能是收到接收方的应答也可能是达到了重传的次数上限),重试次数=0
2020-12-11 13:14:18.658 [defaultEventLoopGroup-5-1] INFO  net.openmob.mobileimsdk.server.ServerCoreHandler:207 - [IMCORE-netty]<< 收到客户端{uid:182}/116.68.223.158:58358的通用数据发送请求.


签名: 怎么发帖子
引用:JackJiang 发表于 2020-12-11 11:51
你发的这个内容大概有多长?(具体的字节数)
用的是tcp协议吗?

这是我发送的内容
{"messageId":"1607663491158563","sendTime":"1607663491200","imageData":"\/9j\/4AAQSkZJRgABAQAA2ADYAAD\/4QCARXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAADYAAAAAQAAANgAAAABAAKgAgAEAAAAAQAAADCgAwAEAAAAAQAAADAAAAAA\/+0AOFBob3Rvc2hvcCAzLjAAOEJJTQQEAAAAAAAAOEJJTQQlAAAAAAAQ1B2M2Y8AsgTpgAmY7PhCfv\/iEXhJQ0NfUFJPRklMRQABAQAAEWhhcHBsAgAAAG1udHJHUkFZWFlaIAfcAAgAFwAPAC4AD2Fjc3BB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ndQXFpeRLb6z8YNZthNDLDNFdaN8LdGupIpUuru5dPGf9I3ws+FngH4KeAfDXwx+GPhrT\/Cfgnwnp6afo2jachCRoC0lxd3dxIXudQ1TULl5b7VNUvZZ7\/Ur+e4vb24muZpJG9Borz\/4p\/CzwD8avAPiX4Y\/E7w1p\/izwT4s099O1rRtRjJSRCRJb3dpPG0dzp+qafcpDfaXqljNBf6ZfwQXtlPDcwRuv83GjaL+0j\/wRl\/aQsNF0TT\/ABZ8bP2NPjZ4stNPsbHT7SfUNSXUtQnitLS3gtbOI22jfGDRrYwwQxQw2ujfFLRrWOKKO1vLVU8Gf\/\/Z","groupUrl":"","msgType":1,"heardUrl":"https:\/\/ss1.bdstatic.com\/70cFuXSh_Q1YnxGkpoWK1HF6hhy\/it\/u=2695212645,926182376&fm=26&gp=0.jpg","nickName":"181”,”chatType":1,"groupName":"","toPeerId":"182”,”fromePeerId":"182","content":" 有没有"}
签名: 怎么发帖子
引用:丢丢立 发表于 2020-12-11 13:31
这是我发送的内容
{"messageId":"1607663491158563","sendTime":"1607663491200","imageData":"\/9j\/4A ...

9278个字符。。。。 你这内容是什么,这么大。。。

SDK里,能最大支持2的32次方个字符(TCP协议),但实际上默认强制限制为6K个字符,目的是防止大包攻击,不过你可以在代码里设置一下最大字节就可以了(官方的Demo工程代码为例)。

iOS端设置方法(位于文件 IMClientManager.m):
[已回复] 求助MobileIMSDK4iLib iOS发送消息内容过长报 301 问题_1.png

Andriod端的设置方法(位于文件 IMClientManager.java):
[已回复] 求助MobileIMSDK4iLib iOS发送消息内容过长报 301 问题_2.png

服务端的设置方法(位于文件 ServerLauncherImpl.java):
[已回复] 求助MobileIMSDK4iLib iOS发送消息内容过长报 301 问题_3.png

官方Demo代码在这里可以找到:https://gitee.com/jackjiang/MobileIMSDK/tree/master/demo_src
引用:JackJiang 发表于 2020-12-11 13:48
9278个字符。。。。 你这内容是什么,这么大。。。

SDK里,能最大支持2的32次方个字符(TCP协议),但 ...

站长,关于图片传输的问题,想问一下,我现在的把图片转成base64字符串进行传输合理不,其他的有啥好的办法没,在站内 看了 《腾讯原创分享(一):如何大幅提升移动网络下手机QQ的图片传输速度和成功率》感觉没有理解,这个图片传输走的是 “消息通道”  还是走的“接口”,麻烦给点指引,谢谢了
签名: 怎么发帖子
引用:丢丢立 发表于 2020-12-11 13:58
站长,关于图片传输的问题,想问一下,我现在的把图片转成base64字符串进行传输合理不,其他的有啥好的办 ...

首先,你要发送超大文本内容,用我在5楼的方法即可解决,
其次,你如果是传图片这种多媒体数据,应该用http,而不是tcp或udp,这是最佳实践问题。
引用:JackJiang 发表于 2020-12-11 13:59
首先,你要发送超大文本内容,用我在5楼的方法即可解决,
其次,你如果是传图片这种多媒体数据,应该用h ...

谢谢,另外帖子主题301未登录那个问题,我用的是udp,我刚才又回复了,如果是因为文本过长导致的301 这个问题那我就先不去考虑了毕竟可以限制长度。
签名: 怎么发帖子
打赏楼主 ×
使用微信打赏! 使用支付宝打赏!

返回顶部