求大神帮助。,无法将缓冲区转换为 socket1。错误代码: 9013。
#include "lrs.h"int time_lr(void *dummy)
{
int num;
unsigned int num0,num1,num2,num3;
unsigned char cnum;
int i=0;
typedef long time_t;
time_t t;
// Get system time and display as number and string
lr_message ("Time in seconds since 1/1/70: %ld\n", time(&t));
num=time(&t);
while(num)
{
cnum = num % 256;
num /= 256;
}
lr_output_message("the binary number is:%02x:%02x:%02x:%02x",cnum,cnum,cnum,cnum);
num0=cnum;
num1=cnum;
num2=cnum;
num3=cnum;
lr_output_message("%x,%x,%x,%x",num0,num1,num2,num3);
lr_save_int(num0,"<NewParam1>");
lr_save_int(num1,"<NewParam2>");
lr_save_int(num2,"<NewParam3>");
lr_save_int(num3,"<NewParam4>");
return;
}
Action()
{
int sc=0;
sc=lrs_create_socket("socket1","TCP","LocalHost=6.6.6.148:8000","RemoteHost=50.0.8.10:6088",LrsLastArg);
if(sc==0)
lr_output_message("Socket was successfully ceated!");
else
lr_output_message("An error occurred while creating socket!");
lr_think_time(1);
time_lr(LrsLastArg);
//发送数据内容
lrs_send("socket1", "buf0", LrsLastArg);
lr_think_time(50);
//关闭连接
lrs_close_socket("socket1");
}
data.ws如下:
"\x02\x00\xfc\x00\x01\x00\x00"
"\x<NewParam1>"
"\x<NewParam2>"
"\x<NewParam3>"
"\x<NewParam4>"
虚拟用户脚本已从 : 2015-08-13 11:00:18 启动
正在开始操作 vuser_init。
vuser_init.c(6): lrs_startup(257)
正在结束操作 vuser_init。
正在运行 Vuser...
正在开始迭代 1。
正在开始操作 Action。
Action.c(46): lrs_create_socket(socket1, TCP, ...)
Action.c(48): Socket was successfully ceated!
Time in seconds since 1/1/70: 1439434818
Action.c(26): the binary number is:42:08:cc:55
Action.c(31): 42,8,cc,55
Action.c(57): lrs_send(socket1, buf0)
Action.c(57): 错误: 无法将缓冲区转换为 socket1。错误代码: 9013。
从操作调用了中止。
正在结束 Vuser...
正在开始操作 vuser_end。
vuser_end.c(6): lrs_cleanup()
正在结束操作 vuser_end。
Vuser 已终止。 应该是参数化导致的,要考虑字符个数是否与传送一致等问题
可参见http://bbs.51testing.com/thread-1000574-1-1.html
页:
[1]