This is the mail archive of the java-discuss@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Can't get sockets to work


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]