Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Sometime sending HTML text to the browser and the nother time not working
that is the code :

C#
static void Main(string[] args)
       {
           TcpListener les = new TcpListener(IPAddress.Parse("127.0.0.1"), 443);
           les.Start();
           while (true)
           {
               Console.WriteLine("Waiting Connection...." + les.Server.LocalEndPoint);
               TcpClient tcp = les.AcceptTcpClient();
               Thread A = new Thread(new ParameterizedThreadStart(TransmatingWithThreading));
               A.Start((object)tcp);
               Thread.Sleep(1000);
           }


       }


Please any body feesback me
Thanks alot
Posted

1 solution

Hi,

I think you're trying to create a local web server. In that case, I recommend to use a System.Net.HttpListener[^] instead of a TcpListener.
Have also a look at my Tip:
Create a local server in C#[^]

Hope this helps.
 
Share this answer
 
v2
Comments
Tarek Selem 15-Apr-13 3:29am    
Realy thank u..
Thomas Daniels 15-Apr-13 12:09pm    
You're welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900