J
Jim P.
I have a TCPClient & TCPListener class that I need to stress test. Using a
GUI, I built a class that would connect and send consecutive messages for 10
seconds, and log the the results in a richTextBox. Problem is that it runs
for a couple seconds, then I get the following error, ending the program:
--------------------------------------
An unhandled exception of type 'System.NullReferenceException' occurred in
system.windows.forms.dll
Additional information: Object reference not set to an instance of an object
--------------------------------------
It seems that it was quitting during a do/while loop that connects & sends
rapid fire 32k messages for 10 seconds. I figured that maybe the
TCPListener couldn't handle the number of request, but the Lsitener class is
designed to call an Error Handler is it can't take any more sockets. So I
used Thread.Sleep(100), and that helped a little. Somethimes it will work
other times it fails. But that doesn't help me locate the source of the
problem.
Visual Studio marks the Application.Run as the source of the problem.
------------------------------
static void Main()
{
Application.Run(new FormClient());
}
------------------------------
But I can't get any more information about the source of the error. So I
wrapped the Application.Run in a try catch block and I still get the above
message and no details. Any idea how I could debug this further? Or know
of any articles on how to use TCPClient to build a TCPListner tester by
sending mass quantities of messages simultaneously?
thanks
GUI, I built a class that would connect and send consecutive messages for 10
seconds, and log the the results in a richTextBox. Problem is that it runs
for a couple seconds, then I get the following error, ending the program:
--------------------------------------
An unhandled exception of type 'System.NullReferenceException' occurred in
system.windows.forms.dll
Additional information: Object reference not set to an instance of an object
--------------------------------------
It seems that it was quitting during a do/while loop that connects & sends
rapid fire 32k messages for 10 seconds. I figured that maybe the
TCPListener couldn't handle the number of request, but the Lsitener class is
designed to call an Error Handler is it can't take any more sockets. So I
used Thread.Sleep(100), and that helped a little. Somethimes it will work
other times it fails. But that doesn't help me locate the source of the
problem.
Visual Studio marks the Application.Run as the source of the problem.
------------------------------
static void Main()
{
Application.Run(new FormClient());
}
------------------------------
But I can't get any more information about the source of the error. So I
wrapped the Application.Run in a try catch block and I still get the above
message and no details. Any idea how I could debug this further? Or know
of any articles on how to use TCPClient to build a TCPListner tester by
sending mass quantities of messages simultaneously?
thanks