leoomo 发表于 2007-7-6 11:40:54

Action.c(6): Error : socket13 - Invalid argument. Error code : 10022.

脚本回放成功
加循环之后运行完脚本后失败
Action.c(6): Error : socket13 - Invalid argument. Error code : 10022.

shanxi 发表于 2007-7-6 12:53:57

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;
}

[ 本帖最后由 shanxi 于 2007-7-6 12:55 编辑 ]

leoomo 发表于 2007-7-6 13:31:17

3ks!sdlkfj3

leoomo 发表于 2007-7-6 13:34:41

我想问问
你的这些英文资料是自己写的还是
在哪里找的啊?
如果是找的,方便透露一下网址吗?

jstm_mm 发表于 2010-10-20 11:07:28

确实是,录脚本的时候没注意这个。

lyhgq321 发表于 2011-12-2 13:26:42

遇到这个问题了,回去检查脚本,就是缺少lrs_close_socket()引起的,补充完整后,就可以了。

灰常感谢楼主

maizi253 发表于 2012-5-17 11:41:13

3Q,今天刚好又遇到这个问题了
页: [1]
查看完整版本: Action.c(6): Error : socket13 - Invalid argument. Error code : 10022.