Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2005

Tip: Looking for answers? Try searching our database.

Duplex socket receiving data too fast?

Thread view: 
Pep - 31 Aug 2005 12:45 GMT
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.
Daniel Dyer - 31 Aug 2005 12:51 GMT
> 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.

Signature

Daniel Dyer
http://www.dandyer.co.uk

Pep - 31 Aug 2005 13:54 GMT
>> 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?

Yes 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
[quoted text clipped - 6 lines]
> the non-working version), then people will be able to see what is going
> wrong.

Yep, I'll do that in a mo.

> Dan.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.