This documentation is archived and is not being maintained.

Windows Forms: Multi-Threaded TCP/IP Listener Sample

Visual Studio .NET 2003

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

  1. Copy all files to your local hard drive by means of the Copy All Files link.
  2. Open the .sln file.
  3. In Solution Explorer, right-click the TCPIPListener solution and select Properties.

    The Solution Property Pages dialog box is displayed.

  4. In the Startup Project page, click Multiple Startup Projects.
  5. Set the Action to Start without debugging for both the Client and Listener projects.
  6. Click OK to close the dialog box.
  7. Press CTRL+F5.
  8. Click Start in the Client form.

See Also

Visual Basic Sample Applications | Visual Basic Walkthroughs | Multithreading in Components

Show: