|
1、被测试的程序是一个中间应用,由于服务器只允许几个ip地址登陆,所以该程序的作用是将其他多个ip转换到这几个ip上,再联服务器
2、使用socket协议录制,录制以后的脚本如下:
int handler=0;
lrs_create_socket("socket0", "TCP", "RemoteHost=192.168.1.123:4545", LrsLastArg);
lrs_send("socket0", "buf0", LrsLastArg);
lrs_set_socket_handler("socket0", handler);
lrs_receive("socket0", "buf1",LrsLastArg);
lrs_close_socket("socket0");
return 0;
3、两次录制脚本相同,但录制的日志不同
第一次:
* WSAStartup(): process 3740 using flags 0 */
/* ReadCommWindowInfo: HttpInterceptMode = 0 */
/* socket(): created with handle: 3740:116, address format 2, type 1, protocol 0. */
/* connect(): socket 3740:116 tried to connect with family 2, port 4545, and address 0xc0a8017b. Return value: 0 */
/* send(): 10000 bytes were sent to socket 3740:116 using flags 0 */
/* recv(): 2748 bytes were received from socket 3740:116 using flags 0 (10000 were asked for) */
/* recv failed */
/* closesocket(): socket 3740:116 closed successfully */
/* WSACleanup() was called on process 3740 */
第二次:
/* WSAStartup(): process 3904 using flags 0 */
/* ReadCommWindowInfo: HttpInterceptMode = 0 */
/* socket(): created with handle: 3904:116, address format 2, type 1, protocol 0. */
/* connect(): socket 3904:116 tried to connect with family 2, port 4545, and address 0xc0a8017b. Return value: 0 */
/* send(): 10000 bytes were sent to socket 3904:116 using flags 0 */
/* recv(): 2748 bytes were received from socket 3904:116 using flags 0 (10000 were asked for) */
/* recv failed */
/* closesocket(): socket 3904:116 closed successfully */
/* WSACleanup() was called on process 3904 */
说明每次的socket handle不同
4、回放脚本,提示错误信息:
Action.c(23): Error : socket0 - Connection reset by peer. Error code : 10054.
5、根据录制的日志信息,我怀疑是因为socket handle的问题,可是脚本中就4句,我应该怎么修改呢?
向各位大虾请教,谢谢? |
|