C# Tutorial – Simple Threaded TCP Server

C# Tutorial – Simple Threaded TCP Server | Switch on the Code

C# Tutorial – Simple Threaded TCP Server

using System;

using System.Text;

using System.Net.Sockets;

using System.Threading;

using System.Net;

namespace TCPServerTutorial

{

  class Server

  {

    private TcpListener tcpListener;

    private Thread listenThread;

    public Server()

    {

      this.tcpListener = new TcpListener(IPAddress.Any, 3000);

      this.listenThread = new Thread(new ThreadStart(ListenForClients));

      this.listenThread.Start();

    }

  }

}

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *

What is 2 + 5 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)