What's wrong with this socket handling (receive blocks send)

  • Thread starter Thread starter Laura T.
  • Start date Start date
L

Laura T.

Hi,

I've this kind a program, using sockets to communicate with the clients. One
of the clients can be a web browser (like IE).
When using IE as a client, the transmission blocks completely, and IE times
out after a long time while stating opening from http://localhost:7765...

I have a main thread that starts TCPListener and listens and accepts the
connection and queues a worker thread to handle the socket transmission:

loop
..
..
try
{
socket=_mainlistener.AcceptSocket();
ThreadPool.QueueUserWorkItem(<proc>,socket)

}
catch()
..
..
end loop

The worker thread starts with Receive and then sends a response and loops
over it until the socket is connected:

<init worker thread>
..
..
while(socket.Connected)
{
socket.Receive(buf,0,768,0);
 
Some missing details, the connection is TCP, the .NET framework is 1.1Sp1
and OS is Win2kSp4.

Laura
 
Back
Top