Modifying the Winsock Stress Test
The Winsock Stress Test does not use the Tux test harness. You must use Netall.dll and Netmain.lib to run this test.
With the Netmain.lib library, you can specify command-line options to modify the behavior of the test. The following table shows the modifications you can make to the test.
To modify the Winsock Stress Test
To | Add this command-line parameter |
---|---|
Redirect output to the console |
|
Redirect output to a file |
|
The following table shows the functions that Netall.dll and Netmain.lib provide.
Function | Description |
---|---|
SetOptionChars | Specifies the character that precedes a command-line option or switch. The "-" character is the default character. |
QAWasOption | Returns a Boolean value that indicates whether a specific command-line option is provided. |
QAGetOption | Returns a Boolean value that indicates whether a specific command-line option is provided. This function also returns the argument for the option as a string, if an argument is provided. |
QAGetOptionAsInt | Returns a Boolean value that indicates whether a specific command-line option is provided. This function also translates the argument for the option to an integer, if an argument is provided, and returns the integer. |
QAGetOptionAsDWORD | Returns a Boolean value that indicates whether a specific command-line option is provided. This function also interprets the argument for the option as a DWORD, if an argument is provided, and returns the value. |
StrictOptionsOnly | Requires command-line options to be specified in the -option <argument> form. By default, this form or the -option<argument> form is accepted. You should apply this requirement if one option is a substring of another option. For example, you should apply this requirement if you support both a -s and a -svr command-line option. |
GetRandomNumber | Generates a random number between 0 and a number that you specify. The random number that the function generates can be the number that you specify. |
GetRandomRange | Generates a random number in the range between two numbers that you specify. |
GetLastErrorText | Translates a Microsoft® Win32® error code into a string. |
QAError | Outputs an error message and records the occurrence of the error. The errors and warnings that occur during a test are output at the end of the test. |
QAWarning | Outputs a warning message and records the occurrence of the warning. The errors and warnings that occur during a test are output at the end of the test. |
QAMessage | Outputs a message. |
QADebug | Outputs a message using the OutputDebugString function regardless of the location specified in the command line. |
QAVerbose | Outputs a message at a specified level of verbosity. If you do not specify a level of verbosity greater than or equal to the level of the message, then the function outputs nothing. |
The following table shows the test cases for the Winsock Stress Test.
Test case | Description |
---|---|
Bind Stress: Bstres2, Bstress2_vx | Binds sockets to varying addresses and ports. You can specify the number of binds to perform in the command line. The test then loads a thread that opens, binds, and then closes the specified number of sockets.
The following command line on the Microsoft® Windows® CE–based device binds 1000 sockets of random type to an unspecified address in groups of 10.
The following command line on the Windows CE–based device binds 100 TCP/IP sockets to any local address on a range of ports starting with port 1024.
The following command line on the Windows CE–based device binds 1000 User Datagram Protocol (UDP) sockets to an IPv6 loopback address.
|
Open/Close Stress: Ocstres2, Ocstres2_vx | Opens and closes a large number of sockets. You can specify the number of sockets to open and close and whether the sockets are bound, connected, or used in data transfers. You can also specify the application that launches the client thread, the server thread, or both.
You can run this test from a single command line or between two separate devices. You should run the server thread before or in the same command line as the client thread. The following command line on the Windows CE–based device opens and closes 1000 sockets of random type in groups of 10.
The following command line on the Windows CE–based device opens, binds, connects, and closes 10,000 sockets in groups of five for IPv4 only.
The following command line on the Windows CE–based device opens, binds, connects, sends data on, receives data on, and then closes 1000 sockets.
You must also run the following command line on the development workstation.
|
Name Resolution Stress: Ghstres2, Ghstres2_vx | Resolves computer names into addresses and addresses into computer names. You can specify the number of resolutions to perform. You can also specify a list of computer names or addresses to resolve.
The test carries out resolutions in two concurrently running threads. One thread resolves computer names to addresses and the other thread resolves addresses to computer names. The test displays the results of the resolutions. The following command line on the Windows CE–based device resolves two computer names 1000 times using the IPv4 gethostbyname function.
The following command line on the Windows CE–based device resolves a computer name and an IP address 1000 times using the IPv4 gethostbyname function and gethostbyaddr function.
The following command line on the Windows CE–based device resolves computer names and IP addresses for both IPv4 and IPv6 1000 times using the getaddrinfo function and getnameinfo function.
|
Receive/Send Stress: Rsstres2, Rsstres2_vx | Stresses the network stack by performing a large number of send or receive operations over a single connection. You can specify in the command line the number of megabytes (MB) of data to transmit.
The test performs send and receive operations using random buffer sizes until the specified amount of data has been transferred. The test displays a message for each MB of data processed. The test can also display the status of each send or receive call. You should run the server thread before or in the same command line as the client thread. The following command line on the Windows CE–based device transfers 20 MB of data from the Windows CE–based device to the development workstation using IPv6.
You must also run the following command lines on the development workstation.
The following command line on the Windows CE–based device transfers 2 MB of data from a UPD client on the development workstation to a server on the local Windows CE–based device.
You must also run the following command line on the development workstation.
The following command line on the Windows CE–based device performs a loopback transmission of 200 MB of data using IPv4.
|
Remarks
You can run each test case with the -?
option to see information about the command-line options for the test case.
See Also
Last updated on Friday, October 08, 2004
© 1992-2003 Microsoft Corporation. All rights reserved.