AnyChat技术支持论坛

标题: 广域网下文件传送失败的问题。 [打印本页]

作者: cdzlj    时间: 2014-4-25 14:00
标题: 广域网下文件传送失败的问题。
版本:anychat V4.9
bug现象:局域网下文件传输没有问题。但是在广域网下,服务端:文件超过300k左右,就发现在server的temp文件夹下有临时文件,而且临时文件比原文件大,业务服务程序收不到回调,过了一段时间(几十秒)后,临时文件消失。客户端:调用QueryTransTaskInfo查询传输状态时,进度不走,速度在变。服务器是公网IP地址,有端口映射,且可能有保护ping不通,但是传输小文件是可以的,是否是因为UDP的传输,不能保证可靠达到,有什么样的措施可以解决文件传送问题吗?


作者: admin    时间: 2014-4-25 14:08
您好,是否有条件测试一下,不通过端口映射的服务器,是否正常?
作者: cdzlj    时间: 2014-4-25 14:16
只有端口映射的公网IP条件,所以,与你们demo.anychat.cn的服务器测试过,也是一样的,你们也可以测试下。
作者: cdzlj    时间: 2014-4-25 14:19
据我所知,你们的服务器好像不存在端口映射的情况,如果情况一样,那么可能你们的机制或许有点问题。
作者: cdzlj    时间: 2014-4-25 14:22
即在udp的基础上完成tcp的功能,可能还有bug,特别是网络情况不是很好的情况,如果你们的服务器在你们局域网的话,可能测试不了。
作者: admin    时间: 2014-4-28 09:16
您好,请参考帖子:http://www.anychat.cn/faq/index. ... =266&artlang=zh ,打开调试模式,然后将出现问题的log帖上来我们帮您分析一下原因。
作者: cdzlj    时间: 2014-4-28 16:57
日志如下:[2014-04-28 16:48:20(770)]    Trans Task Status: srcUserId:1, tarUserId:0, TaskId:28913, Status:7
具体日志文件见附件。

AnyChatCoreServer.rar

2.14 KB, 下载次数: 1

任务编号为:28913


作者: cdzlj    时间: 2014-4-28 16:58
状态为7的是什么,QueryTransTaskInfo这个接口里没有状态为7的说明。
作者: admin    时间: 2014-4-28 18:37
您好,状态7为:用户已离线,是新版本增加的,可能负责文档的同事还没来得及更新上去。

请上传一下文件发起方、文件接收方两边的日志文件:BRAnyChatCore.log


作者: cdzlj    时间: 2014-4-29 13:54
服务端的日志:
[2014-04-29 13:47:04(348)]        Async deliver thread, list:0, pool:2, recv:767, send:0
[2014-04-29 13:47:04(535)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:7

[2014-04-29 13:47:05(535)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:7

[2014-04-29 13:47:05(817)]        UDP Send, send:31(0MByte, 0Mbps), discard:0, error:0, block:0, nicsize:0, func(2.184479, 32.036766), fetch(0.001770, 0.008329), send(0.094222, 0.210660)
[2014-04-29 13:47:06(535)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:7

[2014-04-29 13:47:07(535)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:7

[2014-04-29 13:47:08(535)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:7

[2014-04-29 13:47:09(535)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:7

[2014-04-29 13:47:10(535)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:7

[2014-04-29 13:47:11(535)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:7

[2014-04-29 13:47:12(535)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:7

[2014-04-29 13:47:13(535)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:7

[2014-04-29 13:47:14(535)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:7

[2014-04-29 13:47:15(535)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:7

[2014-04-29 13:47:16(535)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:7

[2014-04-29 13:47:25(551)]        Stream Buffer, item:0, resend:0, delete:0, StreamItemPool(0, 0), SequencePool(0, 0), MediaPackPool(0, 0), packloss:0, ack:0, req:0, fill:0
[2014-04-29 13:47:25(567)]        TCP, new user:0, RecvPackNum:12, RecvPackSize:0 kByte, map:0
[2014-04-29 13:47:25(801)]        UDP Read, read:787(1MByte), error:0, functime(0.031954, 0.935233), dealtime(0.006199, 0.420031)
[2014-04-29 13:48:04(363)]        Async deliver thread, list:0, pool:0, recv:786, send:0
[2014-04-29 13:48:07(613)]        UDP Send, send:17(0MByte, 0Mbps), discard:0, error:0, block:0, nicsize:0, func(1.870947, 32.036766), fetch(0.002094, 0.008329), send(0.078459, 0.210660)
[2014-04-29 13:48:25(551)]        Stream Buffer, item:0, resend:0, delete:0, StreamItemPool(0, 0), SequencePool(0, 0), MediaPackPool(0, 0), packloss:0, ack:0, req:0, fill:0
[2014-04-29 13:48:25(582)]        TCP, new user:0, RecvPackNum:12, RecvPackSize:0 kByte, map:0
[2014-04-29 13:48:25(801)]        UDP Read, read:781(1MByte), error:0, functime(0.045351, 0.935233), dealtime(0.009186, 0.420031)
[2014-04-29 13:49:04(426)]        Async deliver thread, list:0, pool:0, recv:785, send:0
[2014-04-29 13:49:11(067)]        UDP Send, send:23(0MByte, 0Mbps), discard:0, error:0, block:0, nicsize:0, func(1.931025, 32.036766), fetch(0.001959, 0.008329), send(0.179084, 0.210660)
[2014-04-29 13:49:25(551)]        Stream Buffer, item:0, resend:0, delete:0, StreamItemPool(0, 0), SequencePool(0, 0), MediaPackPool(0, 0), packloss:0, ack:0, req:0, fill:0
[2014-04-29 13:49:25(582)]        TCP, new user:0, RecvPackNum:12, RecvPackSize:0 kByte, map:0
[2014-04-29 13:49:25(801)]        UDP Read, read:789(1MByte), error:0, functime(0.022292, 0.935233), dealtime(0.004990, 0.420031)
[2014-04-29 13:50:04(504)]        Async deliver thread, list:0, pool:0, recv:787, send:0
[2014-04-29 13:50:12(051)]        UDP Send, send:18(0MByte, 0Mbps), discard:0, error:0, block:0, nicsize:0, func(1.960875, 32.036766), fetch(0.001444, 0.008329), send(0.079673, 0.210660)
[2014-04-29 13:50:25(551)]        Stream Buffer, item:0, resend:0, delete:0, StreamItemPool(0, 0), SequencePool(0, 0), MediaPackPool(0, 0), packloss:0, ack:0, req:0, fill:0
[2014-04-29 13:50:25(598)]        TCP, new user:0, RecvPackNum:12, RecvPackSize:0 kByte, map:1
[2014-04-29 13:50:25(801)]        UDP Read, read:786(1MByte), error:0, functime(0.026087, 0.935233), dealtime(0.005348, 0.420031)
[2014-04-29 13:51:04(535)]        Async deliver thread, list:0, pool:0, recv:790, send:0
[2014-04-29 13:51:14(192)]        UDP Send, send:20(0MByte, 0Mbps), discard:0, error:0, block:0, nicsize:0, func(2.021221, 32.036766), fetch(0.001241, 0.008329), send(0.094511, 0.210660)
[2014-04-29 13:51:25(551)]        Stream Buffer, item:0, resend:0, delete:0, StreamItemPool(0, 0), SequencePool(0, 0), MediaPackPool(0, 0), packloss:0, ack:0, req:0, fill:0
[2014-04-29 13:51:25(613)]        TCP, new user:0, RecvPackNum:12, RecvPackSize:0 kByte, map:0
[2014-04-29 13:51:25(801)]        UDP Read, read:793(1MByte), error:0, functime(0.022155, 0.935233), dealtime(0.004904, 0.420031)
客户端的日志:
[2014-04-29 13:52:02(953)]        Thread SubRate, userid:1, taskid:19222, dwMaxDeliverNum:2
[2014-04-29 13:52:03(304)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:2

[2014-04-29 13:52:04(319)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:2

[2014-04-29 13:52:05(340)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:2

[2014-04-29 13:52:05(955)]        Thread SubRate, userid:1, taskid:19222, dwMaxDeliverNum:2
[2014-04-29 13:52:06(345)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:2

[2014-04-29 13:52:07(359)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:2

[2014-04-29 13:52:08(380)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:2

[2014-04-29 13:52:08(973)]        Thread SubRate, userid:1, taskid:19222, dwMaxDeliverNum:2
[2014-04-29 13:52:09(393)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:2

[2014-04-29 13:52:10(410)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:2

[2014-04-29 13:52:11(415)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:2

[2014-04-29 13:52:11(979)]        Thread SubRate, userid:1, taskid:19222, dwMaxDeliverNum:2
[2014-04-29 13:52:12(430)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:2

[2014-04-29 13:52:13(451)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:2

[2014-04-29 13:52:14(461)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:2

[2014-04-29 13:52:14(988)]        Thread SubRate, userid:1, taskid:19222, dwMaxDeliverNum:2
[2014-04-29 13:52:15(481)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:2

[2014-04-29 13:52:16(494)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:2

[2014-04-29 13:52:17(509)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:2

[2014-04-29 13:52:18(001)]        Thread SubRate, userid:1, taskid:19222, dwMaxDeliverNum:2
[2014-04-29 13:52:18(523)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:2

[2014-04-29 13:52:19(535)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:2

[2014-04-29 13:52:20(550)]        Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:2
作者: cdzlj    时间: 2014-4-29 13:55
具体日志信息。

AnyChatCoreServer.rar

2.33 KB, 下载次数: 1

BRAnyChatCore.rar

5.62 KB, 下载次数: 1


作者: cdzlj    时间: 2014-4-29 13:56
麻烦请分析下是什么原因。
作者: admin    时间: 2014-4-29 14:10
您好,请提供一下文件发送双方(发送方、接收方)的日志信息,您上面只提供了其中某一方的。
作者: cdzlj    时间: 2014-4-29 14:12
TaskId:19222,在传输过程中,客户端,状态显示在传送,但是未出现 statist taruserid:0, taskid:19222, sendpps:13, recvpps:13, fLossRate:0.00, bitrate:145kbps, finishpacknum:101, dwMaxDeliverNum:9, dwDeliverIncNum:4这个日志的记录。
而服务端在相同时刻,出现 Status:7的记录。我们已经按下面方法控制了网速:
// 限制上传速度为500kbps(62kBps)2.DWORD dwMaxUpRate = 500 * 1000;
3.BRAC_SetSDKOption(BRAC_SO_NETWORK_TRANSBUFMAXBITRATE,(const char*)&dwMaxUpRate, sizeof(DWORD));


客户端日志:

[2014-04-29 13:46:15(704)]    statist taruserid:0, taskid:19222, sendpps:13, recvpps:15, fLossRate:0.00, bitrate:145kbps, finishpacknum:97, dwMaxDeliverNum:8, dwDeliverIncNum:4
[2014-04-29 13:46:16(516)]    Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:2

[2014-04-29 13:46:16(516)]    Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19220, Status:3

[2014-04-29 13:46:16(702)]    addrate - dwMaxDeliverNum:9, dwDeliverIncNum:4
[2014-04-29 13:46:16(703)]    statist taruserid:0, taskid:19222, sendpps:13, recvpps:13, fLossRate:0.00, bitrate:145kbps, finishpacknum:101, dwMaxDeliverNum:9, dwDeliverIncNum:4
[2014-04-29 13:46:17(536)]    Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:2

[2014-04-29 13:46:17(536)]    Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19220, Status:3

[2014-04-29 13:46:18(547)]    Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:2

[2014-04-29 13:46:18(548)]    Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19220, Status:3


[2014-04-29 13:46:19(558)]    Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:2


服务端日志:
[2014-04-29 13:46:15(535)]    Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:2

[2014-04-29 13:46:15(551)]    Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19220, Status:3

[2014-04-29 13:46:16(535)]    Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:2

[2014-04-29 13:46:16(567)]    Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19220, Status:3

[2014-04-29 13:46:17(535)]    Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:7

[2014-04-29 13:46:17(551)]    Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19220, Status:3

[2014-04-29 13:46:18(535)]    Trans Task Status: srcUserId:1, tarUserId:0, TaskId:19222, Status:7



作者: cdzlj    时间: 2014-4-29 14:13
to admin:是提供了双方的哈,有2个压缩文件。
作者: admin    时间: 2014-4-29 15:42
您好,请替换一下附件中的服务器程序,然后再测试看情况如何,同时把两边的log也一并上传,谢谢。

AnyChatCoreServer.rar

314.76 KB, 下载次数: 3


作者: cdzlj    时间: 2014-4-29 16:23
日志如下:传成功2个,还是有1个卡住。

AnyChatCoreServer.rar

2.28 KB, 下载次数: 0

BRAnyChatCore.rar

4.66 KB, 下载次数: 1


作者: cdzlj    时间: 2014-4-29 16:58
服务端没有状态为7的日志,效果基本差不多。如果限速的话,情况会好的多,但究竟该限速好多,有什么规律没有?另外,客户端有没有办法知道传输中用户已离线的消息(就是服务端状态为7时)?用户已离线的状态是不是需要客户端登录一次?还是需要怎么特殊处理?
作者: admin    时间: 2014-5-3 18:46
您好,请重新下载SDK包,更新客户端、服务器程序:更新SDK包:http://www.anychat.cn/download.html,对文件传输部分有优化。




欢迎光临 AnyChat技术支持论坛 (http://bbs.anychat.cn/) Powered by Discuz! X3