51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1663|回复: 0
打印 上一主题 下一主题

[求助] Loadrunner winsocket 接收数据失败,请大神帮忙啊?

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2013-11-23 17:07:35 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
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 里那样写是不是有问题?
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

本版积分规则

关闭

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

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

GMT+8, 2024-11-13 22:06 , Processed in 0.058115 second(s), 23 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

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