|
各位老大,请帮忙分析下列脚本为何在Vugen下运行会出现这个问题:
脚本:简单模拟App发送数据(一系列字符串)给HOST
Action()
{
char *returnvalue;
char *ActualBuffer;
int NumberOfBytes;
int handler;
int i;
lrs_create_socket("socket0", "TCP", "LocalHost=0", "RemoteHost=10.2*.1*.2*:20*", LrsLastArg);
.
.
.
.
lrs_send("socket0", "buf0", LrsLastArg);
for(i=0;i<120;i++)
{
lrs_receive("socket0", "buf1", LrsLastArg);
lrs_get_last_received_buffer("socket0",&ActualBuffer,&NumberOfBytes);
if (NumberOfBytes >0) {
i=120;
lrs_save_param("socket0",NULL,"parameter",0,NumberOfBytes-1);
lr_output_message("new_parameter = \"%s\"\n", lr_eval_string("<parameter>"));
}
}
}
这是一个非常简单的脚本,目的只是为了测试能否从host接收到希望的数据,但在调试时,就出现了下列问题
Action.c(23): lrs_send(socket0, buf0)
Action.c(29): lrs_receive(socket0, buf1)
Action.c(29): Error : socket0 - Connection reset by peer. Error code : 10054.
请问各位如何解决这个问题? |
|