This Java code defines an IMTester class that extends the Thread class. The main method creates 100 instances of IMTester and starts each thread. The run method of each thread establishes a socket connection to localhost port 7777, gets a print writer for the socket output stream, loops 100 times writing a test message to the stream including the thread name and attempt number, sleeps for 10 milliseconds each loop, and finally writes "quit" to the stream before closing the connection.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0 ratings0% found this document useful (0 votes)
41 views
IMTester Java
This Java code defines an IMTester class that extends the Thread class. The main method creates 100 instances of IMTester and starts each thread. The run method of each thread establishes a socket connection to localhost port 7777, gets a print writer for the socket output stream, loops 100 times writing a test message to the stream including the thread name and attempt number, sleeps for 10 milliseconds each loop, and finally writes "quit" to the stream before closing the connection.