|
3#
楼主 |
发表于 2012-4-18 08:32:10
|
只看该作者
本帖最后由 ytcaicai 于 2012-4-19 16:54 编辑
代码:
vuser_init()
{
int c=0;
//c=lrs_create_socket("socket0", "TCP", "LocalHost=0", "RemoteHost=172.31.254.240:9890", LrsLastArg);
c=lrs_create_socket("socket0", "TCP", "RemoteHost=172.31.254.240:9890", LrsLastArg);
if (c==0)
lr_output_message("Socket was sucessfully created");
else
lr_output_message("An error occureed while creatting the socket,error code:%d",c);
return 0;
}
Action()
{
lr_think_time(7);
lrs_send("socket0", "buf0", LrsLastArg);
lrs_receive("socket0", "buf1", LrsLastArg);
....
lrs_send("socket0", "buf94", LrsLastArg);
lrs_receive("socket0", "buf95", LrsLastArg);
lr_think_time(12);
lr_start_transaction("search");
lrs_send("socket0", "buf96", LrsLastArg);
lrs_receive("socket0", "buf97","Flags= MSG_PEEK", LrsLastArg);
lrs_save_param("socket0",NULL,"s_count",0,4);
if (strcmp(lr_eval_string("<s_count>"),"60№")==0)
lr_end_transaction("search", LR_PASS);
else
lr_end_transaction("search", LR_FAIL);
lrs_send("socket0", "buf98", LrsLastArg);
lrs_receive("socket0", "buf99", LrsLastArg);
.....
return 0;
}
协议:windows sockets and oracle(2-tier)
PB开发的c/s/s结构的程序
对应的测试报告:http://bbs.51testing.com/thread-547806-1-3.html |
|