Re: Stream selectively stopping read?



I read my buffer and keep reading in for the data length and then on
completing that i check the next 4 bytes for datalength and if that returns
0 then i discard the rest of the buffer until the next receive where i start
again.

Is this wrong?




"Daniel" <DanielV@xxxxxxxxxxxxxxxx> wrote in message
news:upDeI$ArGHA.3604@xxxxxxxxxxxxxxxxxxxxxxx
Hey guys

i have a tcp stream between client and server.

i am finding that when i send data to the server it receives fine then
sends back and client receives fine.

Now if i repeat that it works one more time. Repeat again and the server
continues to receive, the client continues to send but the reply from
server vanishes, the server says it sent it, there are no issues during
send and yet the client does not receive.

Why would this happen on a stream? The server still says the socket is
connected, which it must be for the client to still be sending and
accordingly it is able to reply down that socket. Yet nothing at the
client end.

Even more strangely if i now send a different command to the sevrer that
will go through and the reply from the server is read and handled by the
client?

Any ideas!?



.



Relevant Pages

  • Re: Socket switch delay
    ... both at the client and at the server (and why ... would you set the send buffer size to zero on a non-overlapped ... One glaring error is your client does ... So when you use a single socket, ...
    (microsoft.public.win32.programmer.networks)
  • Re: Locking on async calls
    ... you must synchronize the entire SendMessage routine as an atomic ... operation to prevent mixed messages from being transmitted to the server. ... You are correct that read and write on the socket do not interfere with each ... If you want to handle multiple client connections from one server object ...
    (microsoft.public.dotnet.general)
  • Re: Design issue with WinSock/GetQueuedCompletionStatus
    ... delegate that to a shutdown routine called after all worker threads ... The application I've created is a server accepting connections on a few ... different TCP/IP ports and then lets the client run different commands. ... a TCP/IP socket can be closed for 2 different reasons: ...
    (microsoft.public.win32.programmer.networks)
  • Re: socket communication: socket doesnt connect
    ... Microsoft MVP, MCSD ... As far as your server code goes, ... accept the listening socket. ... Client client = new Client; ...
    (microsoft.public.vc.language)
  • Re: TCP server stop receiving new connections
    ... reset the event mask of your listening socket each time you ... I have a strange problem in my class library used by all our client ... server applications. ... incomming connections, but keeps current connections. ...
    (microsoft.public.win32.programmer.networks)

Loading