I got a tricky problem:
When I tried to get feedback from the server, the client stuck at the
line:
br.readLine();
br is defined as:
br=new BufferedReader(new InputStreamReader(socket.getInputStream()));
the partial codes:
output.writeBytes(...);
while((line = br.readLine()) != null)
data += line + "\n";
......
Thanks a lot!
-FL
Frank
Also as mentioned in O'Reilly's Java I/O the end of line character
varies from platform to platform. It can be \n\r , \r or \n depending
on your platform. So if you use it in a network situation it's
possible that you could be waiting in vain for the correct
character/s that never come.
Cat
NEW THIS MONTH http://www.ratrobot.com/brainzilla/brainzilla.htm
What's the absolute limit of intelligence in this universe? And why
should I turn of the abflex2000 infomercials long enough to read out
it?
FREE APPLETS http://www.ratrobot.com/java/ratrobot_help.jar JARS
EDITORS CHOICE CartoonPopUps 2.0 . Put cartoon bubbles over your
favourite image link when the cursor is over them.
www.ratrobot.com Articles that challenge your ideas about yourself
and the world you live in.
"Liang(Jeremy) Fang" <lif...@indiana.edu> wrote in message
news:3A272054...@indiana.edu...
> Hi, all,
>
> I got a tricky problem:
> When I tried to get feedback from the server, the client stuck at
> the line:
> br.readLine();
>
> br is defined as:
> br=new BufferedReader(new
> InputStreamReader(socket.getInputStream()));
>
> the partial codes:
> output.writeBytes(...);
> while((line = br.readLine()) != null)
> data += line + "\n";
> ......
>
> Thanks a lot!
>
> -FL
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.8 for non-commercial use <http://www.pgp.com>
iQA/AwUBOibHJCh0Y2LcENUAEQIvawCgw3jPb+BE8xNyllCQX9mRu5on7XcAoOUX
UA43YF1nhfreuXvA1fnP4YdL
=xfgF
-----END PGP SIGNATURE-----
output.flush() after the last output.writeBytes() before you start the
while loop. The server is probably waiting for the rest of the request.
--
Phil Hanna
http://www.philhanna.com
Sent via Deja.com http://www.deja.com/
Before you buy.