Package de.tfh.pdvl.hp.protocol

Examples of de.tfh.pdvl.hp.protocol.Message


   */
  public void visit(QueryMessage m) throws WebAppException {
      ClientConnection conn = connectToServer();
      conn.write(m.toString());
    try {
            Message retMessage = parser.parse(conn.read());
            retMessage.accept(this);
        } catch (MessageParserException e) {
            throw new WebAppException("Invalid message", e);
        } catch (IOException e) {
            throw new WebAppException("Connection to serialServer failed", e);
        } catch (ParentException e) {
View Full Code Here


   */
  public void visit(SetMessage m) throws ParentException  {
      ClientConnection conn = connectToServer();
      conn.write(m.toString());
   
    Message retMessage;
    try {
      retMessage = parser.parse(conn.read());
      retMessage.accept(this);
   
    } catch (MessageParserException e) {
        throw new WebAppException("Invalid message", e);
        } catch (IOException e) {
            throw new WebAppException("Connection to serialServer failed.", e);
View Full Code Here

   * read from the network and a corresponding message is sent back to the client.
   * @throws ParentException
   * @throws IOException
   */
  public void startSession() throws ParentException, IOException {
      Message networkMsg = null;
     
      String networkString = serverConnection.read();
    if (debug) System.err.println("NET:READ:_" + networkString + "_");
    try {
      networkMsg = parser.parse(networkString);
    } catch (MessageParserException e) {
      if (debug) System.err.println("MessageParserException: " + e.getMessage());
      serverConnection.write("error, " + e.getErrorCode() + ", " + e.getMessage());
      serverConnection.closeConnection();
      return;
    }
    try {
            networkMsg.accept(visitor);
            if (debug) System.err.println(returnMessage.toString());
            serverConnection.write(returnMessage.toString());
    }
    catch(SerialServerException e) {
        serverConnection.write("error, " + e.getErrorCode() + ", " +  e.getMessage());
View Full Code Here

TOP

Related Classes of de.tfh.pdvl.hp.protocol.Message

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.