Modifying the Winsock Stress Test (Windows CE 5.0)

Send Feedback

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
-z
Redirect output to a file
-fl

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.

s bstres2_vx -c10 -x

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.

s bstres2_vx -f10 -n100 -b1024 -a

The following command line on the Windows CE–based device binds 1000 User Datagram Protocol (UDP) sockets to an IPv6 loopback address.

s bstres2_vx –u –l::1
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.

s ocstres2_vx -c10 -x -a

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.

s ocstres2 -f200 -n10000 -c5 -h -a -b

The following command line on the Windows CE–based device opens, binds, connects, sends data on, receives data on, and then closes 1000 sockets.

s ocstres2_vx –s <name of target desktop computer> -o -r -a

You must also run the following command line on the development workstation.

ocstres2_vx -o -r -b –z
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.

s ghstres2 -f100 -r1000 -n loopback;localhost

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.

s ghstres2 –f100 -r1000 -n localhost -a 127.0.0.1

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.

s ghstres2_vx –f100 -r1000 -n localhost -a 127.0.0.1;::1
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.

s rsstres2_vx –s –m20 –i6 –c<computer name or IPv6 address of development workstation>

You must also run the following command lines on the development workstation.

ipv6 install
rsstres2_vx –r –m20 –i6 -z

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.

s rsstres2_vx –r –m2 –u

You must also run the following command line on the development workstation.

rsstres2_vx –s –m2 –u –c<CE device> -z

The following command line on the Windows CE–based device performs a loopback transmission of 200 MB of data using IPv4.

s rsstres2_vx –r -s –m200 –i4

Remarks

You can run each test case with the -? option to see information about the command-line options for the test case.

See Also

Winsock Stress Test

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.