LR错误解决_Invalid argument. Error code : 10022.

上一篇 / 下一篇  2009-04-15 16:51:32 / 个人分类:loadrunner

问题描述:

录制windows socket脚本回放成功
在controller中运行脚本失败
Action.c(6): Error : socket13 - Invalid argument. Error code : 10022

 

Problem Description: Error: "socket<number> - Invalid argument. Error code : 10022" when creating a socket on the second iteration

A Winsock script. replays fine on the first iteration, but has the following error during the second iteration on a lrs_create_socket statement:

"Action.c(x): Error : socket<num> - Invalid argument. Error code : 10022."

Diagnosis: This error indicates a failure to create a socket on the second iteration. This is because the socket is not closed on the first iteration.



--------------------------------------------------------------------------------

Solution: Verify that there is a corresponding lrs_close_socket statement in the Action section

Before creating a new socket, the old socket should be closed. This means that if you recorded a script. into Vuser_init, Action, and Vuser_end sections, you need to make sure that the sockets that are opened in the Action section are also closed in the same section, because iterations only iterate the Action section.

Example:
The following code will cause a problem on socket 10 on the second iteration.

Action{
   ...
   lrs_create_socket("socket10" , "TCP", "LocalHost=0”…,LAST );
   ...
}

Vuser_end{
   lrs_close_socket("socket10");
   ...
}

As a resolution, close the socket at the end of the Action section.

Note:
You may need to move all the lrs calls before the lrs_close_socket statement in the Action section as well.

Example:
Action{
   ...
   lrs_create_socket("socket10" , "TCP", "LocalHost=0”…,LAST );
   ...
   lrs_close_socket("socket10");
   return 0;
}


TAG: LR lr socket Windows 错误 windows

引用 删除 xiaoxia318205   /   2011-05-24 18:21:41
5
引用 删除 qiaona_2008   /   2010-06-03 14:31:58
5
 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

Open Toolbar