src/com/wherehoo/WHDataCollector.java
/**
     * Collects data from the client.  <tt>readDataFromClient() listens on the <tt>client_socket</tt> and records
     * the commands and the values as they come in. It does not check these commands nor data for correctness.
     * @return boolean value that indicates whether commands were read succesfully and the client wants to proceed.  
     * It does <i>not</i> indicate whether there were any errors in commands or their parameters. <tt>readDataFromClient()
     * will return <i>false</i> if the client issued BYE command and wishes to disconnect, or some fatal error occured 
     * in data collecting proccess. 
     */
Collects data from the client. readDataFromClient() listens on the client_socket and records
the commands and the values as they come in. It does not check these commands nor data for correctness.
@return boolean value that indicates whether commands were read succesfully and the client wants to proceed.
It does not indicate whether there were any errors in commands or their parameters. readDataFromClient()
will return false if the client issued BYE command and wishes to disconnect, or some fatal error occured
in data collecting proccess.
Collects data from the client . readDataFromClient () listens on the client_socket and records the commands and the values as they come in . It does not check these commands nor data for correctness . @return boolean value that indicates whether commands were read succesfully and the client wants to proceed . It does not indicate whether there were any errors in commands or their parameters . readDataFromClient () will return false if the client issued BYE command and wishes to disconnect or some fatal error occured in data collecting proccess .
public boolean readDataFromClient(){
	boolean proceed = false;
	try {
	    PrintWriter out = new PrintWriter(client_socket.getOutputStream(),true);
	    BufferedReader in = new BufferedReader(new InputStreamReader(client_socket.getInputStream()));
	    String line;
	    String cmd;
	    if (verbose || very_verbose)
		if (very_verbose) System.out.println("READING DATA FROM CLIENT:");
	    do {
		line = in.readLine();
		cmd= this.interpretLine(line,in,out);
		if (very_verbose) System.out.println("returned command: "+cmd);
	    } while (! cmd.equals(".") && ! cmd.equals("bye"));
	    if (very_verbose) System.out.println("got out of the loop that read single lines and interpreted them");
	    if (cmd.equals(".")){
		proceed = true;
	    }
	    if (very_verbose) System.out.println("result "+proceed);
	} catch (IOException ioe){}
	return proceed;
    }
public boolean readDataFromClient ( ) { boolean proceed = false ; try { PrintWriter out = new PrintWriter ( client_socket . getOutputStream ( ) , true ) ; BufferedReader in = new BufferedReader ( new InputStreamReader ( client_socket . getInputStream ( ) ) ) ; String line ; String cmd ; if ( verbose || very_verbose ) if ( very_verbose ) System . out . println ( "READING DATA FROM CLIENT:" ) ; do { line = in . readLine ( ) ; cmd = this . interpretLine ( line , in , out ) ; if ( very_verbose ) System . out . println ( "returned command: " + cmd ) ; } while ( ! cmd . equals ( "." ) && ! cmd . equals ( "bye" ) ) ; if ( very_verbose ) System . out . println ( "got out of the loop that read single lines and interpreted them" ) ; if ( cmd . equals ( "." ) ) { proceed = true ; } if ( very_verbose ) System . out . println ( "result " + proceed ) ; } catch ( IOException ioe ) { } return proceed ; }
Collects data from the client.
Collects data from the client .
//read one line sent by the client
 //interpret the command
 //return false if the client wishes to disconnect or there was a fatal error
