socket problems in a web app

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

Hello,

I have two applications; a test console app and a web service app. They are
both using the same socket code but I'm seeing different results. Perhaps an
expert can advise?

My socket code is real simple, i'm just calling
TcpListener.AcceptTcpClient() which blocks until a client connects to my
socket. When the client connects, it should return with a TcpClient object.
This works just fine in my console app. I've literally cut and pasted this
code into a web application. For some reason though, in my web app this call
never returns even after my client successfully connects to the socket. Its
seems almost as if being in the IIS process is making my socket code act
funny.

Has anyone experienced this before?

Thanks,

-Jim
 
Think i figured it out. Looks like IIS is keeping my socket object in memory
even after i stop the debugger. This is causing my code to throw when i
start a new debugging session and try to open the socket again, because
there's already an instance of that class with the same port opened.
 
Back
Top