Re: Thread abort Problem

Tech-Archive recommends: Fix windows errors by optimizing your registry



Sorry, I still don't understand. Create a complete application that
simulates what you're seeing, indicate what state the socket is in when
you're exiting the application and I'll try to make some time to test it.

Paul T.

<chi.chung.ko@xxxxxxxxx> wrote in message
news:1137629333.310916.186590@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> part of my source code
> System.Threading.ThreadStart startListen = new ThreadStart(listen);
> thd = new Thread(startListen);
> thd.Start();
> -------------------------------
> listen()
> {
> System.Net.IPAddress
> CEAddr = System.Net.Dns.Resolve(dns).AddressList[0];
> server = new TcpListener(CEAddr,port);
> server.Start();
> Byte[] bytes = new Byte[256];
>
> while(true)
> {
> //Console.WriteLine("Waiting for a connection...");
> client = server.AcceptTcpClient();
>
> ..............................
> }
> }
>
> -----------------------
> in form_closing set server.stop will led "client =
> server.AcceptTcpClient();" generate error
>
> if set flag and ignore the error Run In Emu will be ok
>
> but in Real device will be generate another error
> Thanks
>


.



Relevant Pages