debugger deadlocks when tcplistener starts

T

Thos

When I debug a standard socket server app that has a tcplistener using
VS.NET 2005, the debugger deadlocks (uses 100% of one of my CPUs) when
the code runs the tcplistener.Start(). method. I am having the same
problem in a sample socket server app that uses socket.Bind(). Both
deadlock at this point. Both of them worked normally a week ago on a
fresh system (windows xp pro sp2. I have already completely
reinstalled my OS to get rid of this problem before, and now it's
occurring again. Any ideas why? When I stop debugging, it takes it
several minutes to get out of the debugging session and close the app.

Here's the area of code where the problem occurs:

listener = new TcpListener(IPAddress.Any,
details.Port);
***> listener.Start(backLog); <***
listener.BeginAcceptTcpClient(BeginConnection,
listener);

OR

FSocket = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp);
***> FSocket.Bind(LocalEndPoint); <***
FSocket.Listen(FBackLog);

T
 
A

Alvin Bruney [MVP]

How is this a deadlock? What errors are you seeing? That is a rather strong
term to be throwing around.

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley
 
A

Alex Li

***> listener.Start(backLog); <***

Do you know what is the value of backLog?

You may want to run process explorer (www.sysinternals.com) to lower
the priority of your problem app and then find out the number of TCP
connections created by the app and their states as well.

HTH,
Alex
 

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