Duplex socket receiving data too fast?

P

Pep

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.
 
D

Daniel Dyer

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!

Is the helper method working on the same thread?
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?

You should probably post your code (both versions the working version and
the non-working version), then people will be able to see what is going
wrong.

Dan.
 
P

Pep

Daniel said:
Is the helper method working on the same thread?

Yes it is.
You should probably post your code (both versions the working version and
the non-working version), then people will be able to see what is going
wrong.

Yep, I'll do that in a mo.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top