51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1853|回复: 3
打印 上一主题 下一主题

[原创] 大家帮我分析下这段脚本为什么报错~~

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2011-6-9 09:40:38 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
#include "lrs.h"


Action()
{
    lrs_create_socket("socket0", "TCP", "LocalHost=0", "RemoteHost=PC2011051211UZX:6420",  LrsLastArg);

    lrs_create_socket("socket1", "TCP", "LocalHost=0", "RemoteHost=PC2011051211UZX:6530",  LrsLastArg);

    lrs_send("socket1", "buf0", LrsLastArg);

    lrs_receive("socket1", "buf1", LrsLastArg);

    lrs_send("socket1", "buf2", LrsLastArg);

    lrs_receive("socket1", "buf3", LrsLastArg);

    lrs_send("socket1", "buf4", LrsLastArg);

    lrs_create_socket("socket2", "TCP", "LocalHost=60100", "Backlog=16",  LrsLastArg);

    lrs_send("socket1", "buf5", LrsLastArg);

    lrs_receive("socket1", "buf6", LrsLastArg);

    lrs_send("socket1", "buf7", LrsLastArg);

    lrs_receive("socket1", "buf8", LrsLastArg);

    lrs_send("socket1", "buf9", LrsLastArg);

    lrs_receive("socket1", "buf10", LrsLastArg);

    lrs_send("socket1", "buf11", LrsLastArg);

    lrs_send("socket0", "buf12", LrsLastArg);

    lrs_create_socket("socket3", "TCP", "LocalHost=0", "RemoteHost=PC2011051211UZX:65001",  LrsLastArg);

    lrs_receive("socket1", "buf13", LrsLastArg);

    lrs_send("socket1", "buf14", LrsLastArg);

    lrs_receive("socket1", "buf15", LrsLastArg);

    lrs_send("socket1", "buf16", LrsLastArg);

    lrs_receive("socket1", "buf17", LrsLastArg);

    lrs_send("socket1", "buf18", LrsLastArg);

    lrs_receive("socket1", "buf19", LrsLastArg);

    lrs_send("socket1", "buf20", LrsLastArg);

    lrs_receive("socket1", "buf21", LrsLastArg);

    lrs_send("socket3", "buf22", LrsLastArg);

    lrs_receive("socket3", "buf23", LrsLastArg);

    lrs_send("socket1", "buf24", LrsLastArg);

    lrs_send("socket3", "buf25", LrsLastArg);

    lrs_receive("socket1", "buf26", LrsLastArg);

    lrs_receive("socket3", "buf27", LrsLastArg);

    lrs_send("socket1", "buf28", LrsLastArg);

    lrs_send("socket0", "buf29", LrsLastArg);

    lrs_receive("socket1", "buf30", LrsLastArg);

    lrs_send("socket1", "buf31", LrsLastArg);

    lrs_receive("socket1", "buf32", LrsLastArg);

    lrs_send("socket1", "buf33", LrsLastArg);

    lrs_create_socket("socket4", "UDP", "LocalHost=60150",  LrsLastArg);

    lrs_receive("socket4", "buf34", LrsLastArg);

    lrs_send("socket1", "buf35", LrsLastArg);

    lrs_send("socket3", "buf36", LrsLastArg);

    lrs_send("socket0", "buf37", LrsLastArg);

    lrs_receive("socket1", "buf38", LrsLastArg);

    lrs_receive("socket3", "buf39", LrsLastArg);

    lrs_send("socket0", "buf40", LrsLastArg);

    lrs_disable_socket("socket0", DISABLE_SEND_RECV);

    lrs_close_socket("socket0");

    lrs_send("socket1", "buf41", LrsLastArg);

    return 0;
}

回放脚本的日志
Virtual User Script started at : 2011-06-09 09:24:38
Starting action vuser_init.
vuser_init.c(12): lrs_startup(257)
Ending action vuser_init.
Running Vuser...
Starting iteration 1.
Starting action Action.
Action.c(12): lrs_create_socket(socket0, TCP, ...)
Action.c(14): lrs_create_socket(socket1, TCP, ...)
Action.c(16): lrs_send(socket1, buf0)
Action.c(18): lrs_receive(socket1, buf1)
Action.c(20): lrs_send(socket1, buf2)
Action.c(22): lrs_receive(socket1, buf3)
Action.c(24): lrs_send(socket1, buf4)
Action.c(26): lrs_create_socket(socket2, TCP, ...)
Action.c(28): lrs_send(socket1, buf5)
Action.c(30): lrs_receive(socket1, buf6)
Action.c(32): lrs_send(socket1, buf7)
Action.c(34): lrs_receive(socket1, buf8)
Action.c(36): lrs_send(socket1, buf9)
Action.c(38): lrs_receive(socket1, buf10)
Action.c(40): lrs_send(socket1, buf11)
Action.c(42): lrs_send(socket0, buf12)
Action.c(44): lrs_create_socket(socket3, TCP, ...)
Action.c(46): lrs_receive(socket1, buf13)
Action.c(48): lrs_send(socket1, buf14)
Action.c(50): lrs_receive(socket1, buf15)
Action.c(52): lrs_send(socket1, buf16)
Action.c(54): lrs_receive(socket1, buf17)
Action.c(54): Mismatch in buffer's length (expected 33 bytes, 5062 bytes actually received, difference in 5029 bytes)
Action.c(56): lrs_send(socket1, buf18)
Action.c(58): lrs_receive(socket1, buf19)
Action.c(58): Mismatch in buffer's length (expected 291 bytes, 66 bytes actually received, difference in 225 bytes)
Action.c(60): lrs_send(socket1, buf20)
Action.c(62): lrs_receive(socket1, buf21)
Action.c(62): Error : socket1 - Software caused connection abort. Error code : 10053.
Abort was called from an action.
Ending Vuser...
Starting action vuser_end.
vuser_end.c(12): lrs_cleanup()
Ending action vuser_end.
Vuser Terminated.


每次回放 10053报错的位置不一样,但都是在 lrs_receive函数之后报错。。。


C/S架构  SOCKET协议录制
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

  • TA的每日心情
    奋斗
    2022-5-8 19:23
  • 签到天数: 137 天

    连续签到: 1 天

    [LV.7]测试师长

    2#
    发表于 2011-6-11 16:27:00 | 只看该作者
    Mismatch in buffer's length  

    receive得到的长度与录制时不一致
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    3#
    发表于 2012-1-12 10:48:46 | 只看该作者
    Mismatch in buffer's length  

    receive得到的长度与录制时不一致
    msnshow 发表于 2011-6-11 16:27



        这种要怎么解决呢
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    4#
    发表于 2012-2-10 16:03:31 | 只看该作者
    同样遇到该问题
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-11-15 05:50 , Processed in 0.067461 second(s), 27 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表