Re: Server can receive but cant send even tho both sockets are open?

Tech-Archive recommends: Fix windows errors by optimizing your registry



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?







.



Relevant Pages

  • Re: strange multithreaded read() behavior
    ... will a client socket test true for reading all the time? ...
    (comp.unix.solaris)
  • Re: strange multithreaded read() behavior
    ... will a client socket test true for reading all the time? ...
    (comp.unix.programmer)
  • Re: Winsock Send hangs thread
    ... Then the client is not reading all of the sent data, ... socket's internal buffer to eventually fill up. ... Because the socket has no room available to send more data. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: UNIX domain sockets
    ... >> I have written a very simple client and server system to test this. ... > to this socket, and flushing an input buffer should rarely be done. ... > I recommend getting and reading a copy of "Unix Network Programming, ...
    (comp.lang.perl.misc)
  • Re:Sockets in Cocoa
    ... For socket communications, you should ... I am writting a chat client for a not so known client ... Nothing really worked so now I'm reading through ... Should I just stick to socketused in Unix Network Programming? ...
    (comp.sys.mac.programmer.help)