|
5#
楼主 |
发表于 2009-3-17 11:43:44
|
只看该作者
下面是成功录制的代码:
vuser_int:
/*********************************************************************
* Created by Mercury Interactive Windows Sockets Recorder
*
* Created on: Mon Mar 16 19:29:21
*********************************************************************/
#include "lrs.h"
vuser_init()
{
lrs_startup(257);
lrs_create_socket("socket0", "TCP", "RemoteHost=10.XX.XX.78:6X80", LrsLastArg);
lrs_send("socket0", "buf0", LrsLastArg);
lrs_receive("socket0", "buf1", LrsLastArg);
lrs_disable_socket("socket0", DISABLE_SEND_RECV);
lrs_close_socket("socket0");
lr_think_time(22);
lrs_create_socket("socket1", "TCP", "RemoteHost=10.XX.XX.78:6X80", LrsLastArg);
lrs_send("socket1", "buf2", LrsLastArg); /*发送登录信息*/
lrs_receive("socket1", "buf3", LrsLastArg);/*返回登录结果*/
lrs_disable_socket("socket1", DISABLE_SEND_RECV);
lrs_close_socket("socket1");
return 0;
}
Action:
/*********************************************************************
* Created by Mercury Interactive Windows Sockets Recorder
*
* Created on: Mon Mar 16 19:29:21
*********************************************************************/
#include "lrs.h"
Action()
{
/* lr_think_time(25);*/
lrs_create_socket("socket2", "TCP", "RemoteHost=10.XXX.XXX.78:6X80", LrsLastArg);
lrs_send("socket2", "buf4", LrsLastArg);/*发送查询代码,查询户号*/
lrs_receive("socket2", "buf5", LrsLastArg);/*接收查询户号返回信息*/
lrs_disable_socket("socket2", DISABLE_SEND_RECV);
lrs_close_socket("socket2");/*关闭SOCKET连接*/
/* lr_think_time(15);*/
lrs_create_socket("socket3", "TCP", "RemoteHost=10.XXX.XXX.78:6X80", LrsLastArg);
lrs_send("socket3", "buf6", LrsLastArg);/**/
lrs_receive("socket3", "buf7", LrsLastArg);/**/
lrs_disable_socket("socket3", DISABLE_SEND_RECV);
lrs_close_socket("socket3");
/* lr_think_time(69);*/
lrs_create_socket("socket4", "TCP", "RemoteHost=10.XXX.XXX.78:6X80", LrsLastArg);
lrs_send("socket4", "buf8", LrsLastArg);/**/
lrs_receive("socket4", "buf9", LrsLastArg);/*返回成功与失败信息*/
lrs_disable_socket("socket4", DISABLE_SEND_RECV);
lrs_close_socket("socket4");
return 0;
} |
|