wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Reading Socket!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Reading Socket!!" Watch "Reading Socket!!" New topic
Author

Reading Socket!!

arun mahajan
Ranch Hand

Joined: Dec 07, 2001
Posts: 305
Hello Everybody,

I get stuck up in the following code. I am trying to do the following:

1. Making a connection
2. Writing something on it.
3. Reading from the socket.

Surprisingly while trying to read from the socket it fails toread anything in first attempt. Even trying available() method returns 00. but a subsequent reading always gives me the data back available on the socket. Though even in this attempt the available() method returns 0.

Why it is showing such a behaviour? Am I doing something wrong? Can you pl help me

regards,
Arun

Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1817

This seems a bit beyond the beginner stage, so I'm moving it to the I/O and Streams forum. Mayhaps you'll get a better answer there.


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reading Socket!!
 
Similar Threads
A j2me program for bandwidth test
Exception in thread "main" java.security.InvalidKeyException:
Reading Socket!!
Problem overloading method
Generating list of colours.