51Testing软件测试论坛
标题:
Loadrunner winsocket 接收数据失败,请大神帮忙啊?
[打印本页]
作者:
yingzi8016
时间:
2013-11-23 17:54
标题:
Loadrunner winsocket 接收数据失败,请大神帮忙啊?
action.c的处理
char *actual_buffer;
int num_bytes;
...........
lrs_save_param_ex("socket0","user",(char *)&pack,0,pack.length,NULL,"sendData");
lrs_startup(257);
rc=lrs_create_socket("socket0","UDP","LocalHost=<ip>:4096","RemoteHost=192.168.16.210:8805", LrsLastArg);
if (rc == 0) {
lr_output_message("socke 连接成功!");
}else{
lr_output_message("socke 连接失败!");
}
rc = lrs_send ("socket0","buf0" ,LrsLastArg );
if (rc == 0) {
lr_output_message("send buf success !");
}else{
lr_output_message("send buf failed !");
}
rc = lrs_receive ("socket0","buf1" ,LrsLastArg );
if (rc == 0) {
lr_output_message("recv buf success !");
}else{
lr_output_message("recv buf failed !");
}
lrs_get_last_received_buffer("socket0",&actual_buffer,&num_bytes);
lrs_save_param_ex("socket0", "user", actual_buffer, 0, num_bytes, NULL, "recv_data");
lr_output_message("The new parameter = %s \n", lr_eval_string("<recv_data>"));
lrs_close_socket("socket0");
data.ws
;WSRData 2 1
send buf0 *
"<send_data>"
recv buf1 *
-1
打印信息
Action.c(411): lrs_receive(socket0, buf1) [MsgId: MMSG0]
Action.c(411): fiInitRecv: socket: socket0 (644), buffer: buf1, expected size: 0 [MsgId: MMSG0]
Action.c(411): callRecv: Sat Nov 23 16:27:56.625: About to read 0 bytes from socket0 (644) [MsgId: MMSG0]
Action.c(411): getAsciiReceivedBuffer: Sat Nov 23 16:27:56.625: Translate data for printing [MsgId: MMSG0]
Action.c(411): getAsciiReceivedBuffer: Sat Nov 23 16:27:56.625: Binary to ascii [MsgId: MMSG0]
================================RECEIVED BUFFER================================ [MsgId: MMSG0]
[MsgId: MMSG0]
=============================================================================== [MsgId: MMSG0]
Action.c(411): callRecv:data was received from tzh [MsgId: MMSG0]
Action.c(411): callRecv:0 bytes were received [MsgId: MMSG0]
Action.c(414): recv buf success ! [MsgId: MMSG-17999]
不知道为何接收数据一直为0,数据是动态变化,长度不固定,不知道data.ws 里那样写是不是有问题?
作者:
lsekfe
时间:
2014-6-20 15:15
应该出在关联上,如果不是的话应该是winsocket协议版本的问题~
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2