|
服务端开启监听端口2001
action脚本如下:
#include "lrs.h"
Action()
{
int i;
int rc;
char paraData[]="<NewParam>";
//====================================================================================
//建立到服务端的socket连接
rc=lrs_create_socket("socket0", "TCP", "RemoteHost=127.0.0.1:2001", LrsLastArg);
//for(i=0;i<8;i++)
//{
lrs_save_param_ex("socket0","user",lr_eval_string(paraData),0,strlen(lr_eval_string(paraData)),NULL,"NewParam");
//标记开始
lr_start_transaction("yes");
//
lrs_send("socket0", "buf0", LrsLastArg);
//
//lrs_receive("socket0", "buf1", LrsLastArg);
//标记结束
lr_end_transaction("yes", LR_AUTO);
//}
lr_think_time(2);
//释放缓存
//lrs_free_buffer(paraData);
//关闭连接
lrs_close_socket("socket0");
}
运行结束后,服务端程序CPU上升至50,再回放一遍,上升至90
菜鸟一个刚开始学习,请教各位哪里有问题? |
|