Can't get sockets to work
Warren Levy
warrenl@cygnus.com
Mon May 24 12:38:00 GMT 1999
On Mon, 24 May 1999, Lincoln Spiteri wrote:
> I am trying to get the code below to work, it is a simple server app which
> echos any text it receives and then dies. The problem is that if compile this
> and run it with the JDK all is ok. I telnet my machine on port 7070 type in
> something and get 'Echo: something' back.
>
> If I try this with GCJ the server runs but when I telnet to it, it recieves my
> input but the 'Echo: something' does not appear on the client side.
Lincoln, try doing an os.flush(); right after your os.print of the echo
request. I suspect that the close of the Socket is not flushing the
output as is apparently happening in the JDK. Though adding the os.flush();
fixed the behavior using gcj on my platform, it'll take a bit more
investigation to determine what libgcj should be doing.
Thanks for reporting this!
--warrenl
More information about the Java
mailing list