Duplex socket receiving data too fast?



I have a duplex socket that I write data over and then read the data back
but this seems to happen too fast?

Essentially, if I write the data over the socket and then immediately read
the response back from the socket, I have no problems.

However this is not what I need to do. I am attempting to jump from a
central method to a helper method to write a message over the socket then
when I have returned back to the original method I attempt to read the data
in but there is no data to read!

Every time I change the code to read in the same method I did the write in
the application gets the data back but not when I change it back to how it
is intended to work.

The socket is static and I have checked the address etc, between the methods
to ensure that the correct socket is being used, which it is.

It's almost as if the socket only holds the data for a minute amount of
time, which is less then amount of time taken to return through the stack,
then purges the content.

Any ideas why this is happening?

TIA,
Pep.


.



Relevant Pages

  • Re: Data sent - flushing remainder
    ... thought i could append the data size to be expected to the first 4 bytes. ... Are you saying i should receive until i get the full amount of data being ... And as there is no end of data character and i do not close ... the socket i have no way of telling it when to stop. ...
    (microsoft.public.win32.programmer.networks)
  • Re: Socket recv() question?
    ... There's a limited amount of RAM in CE devices. ... Configure tx timeout ... increasing the timeout using the select method on the socket descriptor. ... sockets to send binary data from a pc to Pocket PC. ...
    (microsoft.public.windowsce.app.development)
  • FIN_WAIT1
    ... At first I thought it was some DNS problem.. ... some memory problem because I saw my amount of available memory dropping ... After increasing the amount of swap memory ... and socket handling shouldn't be a problem I guess. ...
    (comp.os.linux.networking)
  • Re: [Python-Help] Reading from socket file handle took too long
    ... I think the real culprit for slowing this process is in the httplib that urllib2 is using, and the problem come probably from the way httplib read from the socket. ... Especially since it should really amount to copying the ...
    (comp.lang.python)
  • Re: Advice on writing server daemon
    ... > new instance of the program, passing it the socket. ... > socket itself, forking for each connection. ... make any unix program, ... creates thousands of short-lived processes in a short amount of time. ...
    (comp.unix.programmer)