TcpListener.Start() segfaults

T

Thos

I have a TcpListener that gets started from a GUI button event
handler:

TcpListener listener;
listener = new TcpListener(IPAddress.Any, 1234);
listener.Start(backLog);

As soon as the third line runs, the app freezes, the CPU goes to 100%
on that CPU (Core Duo) and debugging can't break out of it. I can't
even stop the process with the Task Manager but have to reboot to get
it to stop.

Any ideas what's wrong? This is with Visual Studio 2005. I had .Net
3.0 and the newest Windows SDK installed, but just uninstalled them
and it's still a problem.

T
 
M

Mubashir Khan

Thos said:
I have a TcpListener that gets started from a GUI button event
handler:

TcpListener listener;
listener = new TcpListener(IPAddress.Any, 1234);
listener.Start(backLog);

As soon as the third line runs, the app freezes, the CPU goes to 100%
on that CPU (Core Duo) and debugging can't break out of it. I can't
even stop the process with the Task Manager but have to reboot to get
it to stop.

Any ideas what's wrong? This is with Visual Studio 2005. I had .Net
3.0 and the newest Windows SDK installed, but just uninstalled them
and it's still a problem.

T
 
M

Mubashir Khan

Thos said:
I have a TcpListener that gets started from a GUI button event
handler:

TcpListener listener;
listener = new TcpListener(IPAddress.Any, 1234);
listener.Start(backLog);

As soon as the third line runs, the app freezes, the CPU goes to 100%
on that CPU (Core Duo) and debugging can't break out of it. I can't
even stop the process with the Task Manager but have to reboot to get
it to stop.

Any ideas what's wrong? This is with Visual Studio 2005. I had .Net
3.0 and the newest Windows SDK installed, but just uninstalled them
and it's still a problem.

T
 
M

Mubashir Khan

it seems like a synchronous call ....... your thread is waiting ... thus not
dispatching the UI messages .... either use secondry thread for listening
....... or use asynchronous methods of socket ....
 
T

Thos

It runs fine when it is not run in debugging mode, and it also ran
fine in debugging in the past (I think before I installed .Net 3.0).
Any workarounds? I should have to do a tcplistener.start on a
background thread just to make the VS debugger happy.

T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top