From mpogue@apache.org Wed May 10 18:55:15 2000 Return-Path: Mailing-List: contact general-help@xml.apache.org; run by ezmlm Delivered-To: mailing list general@xml.apache.org Received: (qmail 18293 invoked from network); 10 May 2000 18:55:15 -0000 Received: from unknown (HELO mailgate1.austin.ibm.com) (192.35.232.18) by locus.apache.org with SMTP; 10 May 2000 18:55:15 -0000 Received: from netmail.austin.ibm.com (netmail.austin.ibm.com [9.53.250.98]) by mailgate1.austin.ibm.com (AIX4.3/8.9.3/8.9.3) with ESMTP id NAA34502 for ; Wed, 10 May 2000 13:49:32 -0500 Received: from popmail.austin.ibm.com (popmail.austin.ibm.com [9.53.247.178]) by netmail.austin.ibm.com (8.8.5/8.8.5) with ESMTP id NAA56646 for ; Wed, 10 May 2000 13:55:02 -0500 Received: from apache.org (socks2.almaden.ibm.com [9.1.40.50]) by popmail.austin.ibm.com (AIX4.2/UCB 8.7/8.7-client1.01) with ESMTP id NAA20764 for ; Wed, 10 May 2000 13:55:00 -0500 (CDT) Message-ID: <3919B0E4.E4C4F345@apache.org> Date: Wed, 10 May 2000 11:56:36 -0700 From: Mike Pogue Organization: xml.apache.org X-Mailer: Mozilla 4.72 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: general@xml.apache.org Subject: Re: Java Help References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Does this have anything to do with XML? Mike Octav Chipara wrote: > > Hi, > > I hope that among you there are some Java genius able to help me. I am > trying to make a client and a have big problem in Java not waiting for the > for the server to end its message. Do you have any idea how can I get > around this problem. Any ideas and suggestions are more then welcomed. > > Thanks, > Octav > > PS: My code is: > > import java.net.*; > import java.io.*; > > public class Client1_0 { > > //Main method > public static void main(String[] args) throws IOException > { > Socket NewSocket=null; > PrintWriter out=null; > BufferedInputStream in=null; > > //String HostName="cse-mfayad2.unl.edu"; > String HostName="cse.unl.edu"; > DataInputStream stdin= new DataInputStream(System.in); > > try > { > System.out.println("Starting to tests..."); > NewSocket=new Socket(HostName,21); > out= new PrintWriter(NewSocket.getOutputStream(),true); > in = new BufferedInputStream(NewSocket.getInputStream(), 1000); > } catch (UnknownHostException e){ > System.err.println("Unknown host ("+HostName+")"); > System.exit(-1); > } catch (IOException e) { > System.err.println("Could not get IO access to "+HostName); > System.exit(-1); > }; > System.out.println("Connection to "+HostName+" established"); > > byte i; > String UI; > int j; > int size=0; > > while (size==0) size=in.available(); > for (j=0;j > while (true) > { > UI=stdin.readLine(); > out.println(UI); > try > { > in.wait(); > size=0; > while (size==0) size=in.available(); > size=in.available(); > System.out.println("****"+size); > for (j=0;j } catch ( > } catch (EOFException e) { > System.err.println("OK"); > } catch (IOException e) { > System.err.println("OK"); > }; > }; > }; > }; > > --------------------------------------------------------------------- > In case of troubles, e-mail: webmaster@xml.apache.org > To unsubscribe, e-mail: general-unsubscribe@xml.apache.org > For additional commands, e-mail: general-help@xml.apache.org