G
Guest
I have a fully asynch socket server application. I find however that
sometimes it locks up.
The client sends me a packet before I have posted a BeginRead. My beginread
then completes but I never get called back. Both sides end up waiting for
each other.
THe IAsyncResult return by BeginRead has IsCompleted=false
At first I thought it might be becuase I was doing some sycn IO during
client connection but I have made that all async too and I still get the
occasional lockup
I am sure I am doing something dumb but I cant see what. I always fail if my
trace show client send packet followed by server beginread but if the 2
process time just slighly differnt and I get server beginread then client
send packet then all is fine.
If I kill the client and run it again all is fine. The server pending
callback is invoked saying that the socket closed and the server cleans up
OK. Then we get into the same race with this next client
sometimes it locks up.
The client sends me a packet before I have posted a BeginRead. My beginread
then completes but I never get called back. Both sides end up waiting for
each other.
THe IAsyncResult return by BeginRead has IsCompleted=false
At first I thought it might be becuase I was doing some sycn IO during
client connection but I have made that all async too and I still get the
occasional lockup
I am sure I am doing something dumb but I cant see what. I always fail if my
trace show client send packet followed by server beginread but if the 2
process time just slighly differnt and I get server beginread then client
send packet then all is fine.
If I kill the client and run it again all is fine. The server pending
callback is invoked saying that the socket closed and the server cleans up
OK. Then we get into the same race with this next client