This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Re: Can't get sockets to work
- To: Lincoln Spiteri <lincoln.spiteri@st.com>
- Subject: Re: Can't get sockets to work
- From: Warren Levy <warrenl@cygnus.com>
- Date: Mon, 24 May 1999 12:38:50 -0700 (PDT)
- cc: java-discuss@sourceware.cygnus.com
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