Re: Server can receive but cant send even tho both sockets are open?
- From: "Alexander Nickolov" <agnickolov@xxxxxxxx>
- Date: Mon, 3 Jul 2006 11:33:27 -0700
A common mistake with asynchronous sockets is not resetting
the socket for notifications via WSAAsyncSelect after reading.
There's a race condition between the posted messages and
the data arriving in the socket. Essentially, you may read the
data before the notification for it is sent. Then when you process
that notification there's no data. When new data arrives Winsock
thinks it has alteady sent you a notification and does send another.
Explicitly calling WSAAsyncSelect after read resets Winsock
and any new data will be reported via notification.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
"Daniel" <DanielV@xxxxxxxxxxxxxxxx> wrote in message
news:OCKZllHnGHA.3340@xxxxxxxxxxxxxxxxxxxxxxx
Asynchronous.
What i dont understand is it is reading fine then randomly it seems stops
reading but continues to send? Other times it runs fine for the duration
of my app.
"Alexander Nickolov" <agnickolov@xxxxxxxx> wrote in message
news:ulK2ziHnGHA.2128@xxxxxxxxxxxxxxxxxxxxxxx
Most likely your client isn't reading from the socket. What socket
I/O model do you use?
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
"Daniel" <DanielV@xxxxxxxxxxxxxxxx> wrote in message
news:O8vOjNFnGHA.4224@xxxxxxxxxxxxxxxxxxxxxxx
Hi guys
I have a problem where my server and client speak to each other fine
(coded using sockets by the way) and then for what would seem no reason
they randomly are unable to talk.
What makes it stranger is the socket is fine ont he client end and the
server side. The client is still able to send to the server and the
server does receive the data from the client, processes it and then
seems to send it back but the client never receives it?
Any ideas why it would do that? Where one end of a socket can send and
receive and one end seems to get stuck only being able to send?
.
- Prev by Date: Re: blocking non blocking
- Next by Date: Re: InternetWriteFile performance question
- Previous by thread: Re: Server can receive but cant send even tho both sockets are open?
- Next by thread: Re: DCHP Complete
- Index(es):
Relevant Pages
|