CSharpUtils.Http.Server.HttpServer.Listen C# (CSharp) Метод

Listen() публичный Метод

public Listen ( ushort Port = 80, string Address = "0.0.0.0", bool Launch = false ) : void
Port ushort
Address string
Launch bool
Результат void
		public void Listen(ushort Port = 80, string Address = "0.0.0.0", bool Launch = false)
		{
			this.Port = Port;
			this.Address = Address;
			TcpListener = new TcpListener(IPAddress.Parse(Address), Port);
			Console.Write("Listening: {0}:{1}...", Address, Port);
			TcpListener.Start(16);
			//TcpListener.Start();
			Console.WriteLine("Ok");

			if (Launch)
			{
				System.Diagnostics.Process.Start("http://localhost:8080/");
			}

			while (true)
			{
				ThreadPool.QueueUserWorkItem(HandleAcceptedSocket, TcpListener.AcceptSocket());
			}
		}