Logo Search packages:      
Sourcecode: fex version File versions  Download package

String fix::Sender::receive ( BufferedReader  from_server  )  [inline]

Receives the response from the server and writes it to an OutputStream

Returns:
response from server

Definition at line 354 of file Sender.java.

References fix::ErrorWindow::setMess().

Referenced by send().

                                                        {
            String s = "";
            String result = "";
            try {
                  while (((s = from_server.readLine()) != null) && s.length() > 0) {
                        result = result + s + "\r\n";
                        if (debug) {
                              System.err.println("\t" + s);
                        }
                  }
            } catch (IOException e) {
                  if (e.getMessage().equals("Connection reset")) { // &&
//                      e.getClass().equals(new java.net.SocketException())) {
                              System.out.println("Communication terminated. Server has reset the connection.");
                  }
                  lastReply = result.split("\r\n")[0];
                  er.setMess("Can not read from Server: " + lastReply, e);
            }
            lastReply = result.replaceAll("\r\n$", "");
            return lastReply;
      }


Generated by  Doxygen 1.6.0   Back to index