Windows Forms: Multi-Threaded TCP/IP Listener Sample
The MultiThreaded TCP/IP Listener sample demonstrates a technique for creating a multi-threaded application that generates and listens for TCP/IP traffic. The TCPIPClient application submits multiple TCP/IP calls to the listener component. The TCPIPListener application creates threads that listen for TCP/IP requests. This sample shows how to use critical sync locks to update a single counter on the server.
This sample features Windows Forms, the .NET Framework, and threading.
Note To install and run this sample, you must be a member of your computer's Debugger Users group. If installing this application by means of a remote session, you must be a member of the Administrators group.
To run this sample
- Copy all files to your local hard drive by means of the Copy All Files link.
- Open the .sln file.
- In Solution Explorer, right-click the TCPIPListener solution and select Properties.
The Solution Property Pages dialog box is displayed.
- In the Startup Project page, click Multiple Startup Projects.
- Set the Action to Start without debugging for both the Client and Listener projects.
- Click OK to close the dialog box.
- Press CTRL+F5.
- Click Start in the Client form.