public Server() { IPAddress localhost = IPAddress.Parse("127.0.0.1"); TcpListener listener = new TcpListener(localhost, 1000); clients = new List<ServerClientThread>(); listener.Start(); TcpClient client = listener.AcceptTcpClient(); ServerClientThread cl = new ServerClientThread(client, this); clients.Add(cl); //Run client on new thread Thread thread = new Thread(new ThreadStart(cl.run)); thread.IsBackground = true; thread.Start(); }
public Server() { IPAddress localhost = IPAddress.Parse("127.0.0.1"); TcpListener listener = new TcpListener(localhost, 1000); clients = new List <ServerClientThread>(); listener.Start(); TcpClient client = listener.AcceptTcpClient(); ServerClientThread cl = new ServerClientThread(client, this); clients.Add(cl); //Run client on new thread Thread thread = new Thread(new ThreadStart(cl.run)); thread.IsBackground = true; thread.Start(); }