51Testing软件测试论坛

标题: Action.c(6): Error : socket13 - Invalid argument. Error code : 10022. [打印本页]

作者: leoomo    时间: 2007-7-6 11:40
标题: 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
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
3ks!sdlkfj3
作者: leoomo    时间: 2007-7-6 13:34
我想问问
你的这些英文资料是自己写的还是
在哪里找的啊?
如果是找的,方便透露一下网址吗?
作者: jstm_mm    时间: 2010-10-20 11:07
确实是,录脚本的时候没注意这个。
作者: lyhgq321    时间: 2011-12-2 13:26
遇到这个问题了,回去检查脚本,就是缺少lrs_close_socket()引起的,补充完整后,就可以了。

灰常感谢楼主
作者: maizi253    时间: 2012-5-17 11:41
3Q,今天刚好又遇到这个问题了




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2