|
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 编辑 ] |
|