|
关于LoadRunner的变量赋值问题
例如:定义 char xxx[7];
buf1->12345
buf2->1234567890abcdefg 1234567890
我现在想调用buf2里的全部结果中的 abcdefg 放到 buf3里来进行数据的发送
怎么做?
代码:
rc=lrs_create_socket("socket1", "TCP", "RemoteHost=XXXX", LrsLastArg);
if(rc != 0)
{
lr_output_message("创建连接失败 %s ",rc);
return 0;
}
lrs_send ("socket1", "buf1", LrsLastArg );
lrs_receive("socket1", "buf2", "Flags= MSG_PEEK", LrsLastArg);
len=lrs_get_last_received_buffer_size("socket1");
if (len < 1) {
lr_error_message("没有任何数据收到");
return -1 ;
}
ReceivedBuffer = lrs_get_received_buffer("socket1",0, len, NULL);
lr_output_message("接收到的数据 %s ",ReceivedBuffer);
lrs_disable_socket("socket1", DISABLE_SEND_RECV);
rc=lrs_close_socket("socket1");
if (rc==0)
{lr_output_message("Socket 1 was successfully closed "); }
else
{lr_error_message("An error occurred while closing the socket, Error Code: %d", rc); } |
|