51Testing软件测试论坛

标题: 大家帮我分析下这段脚本为什么报错~~ [打印本页]

作者: q1270227653    时间: 2011-6-9 09:40
标题: 大家帮我分析下这段脚本为什么报错~~
#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协议录制
作者: msnshow    时间: 2011-6-11 16:27
Mismatch in buffer's length  

receive得到的长度与录制时不一致
作者: 87yiduo    时间: 2012-1-12 10:48
Mismatch in buffer's length  

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



    这种要怎么解决呢
作者: qq2949119    时间: 2012-2-10 16:03
同样遇到该问题




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2