Esempio n. 1
0
 // -----------------------------------------------------------
 // receive an initResponse message
 public static void initResponse(Socket s) throws GenericException {
   System.out.println("Receiving init");
   Message m = Message.receive(s);
   System.out.println("Init received");
   MessageType t = m.getMessageType();
   if (t == MessageType.INIT_RSP) return;
   else if (t.isErrorType())
     throw new GenericException("Server encountered an " + t.getDescription());
   else throw new GenericException("Server's response is of an unexpected type: " + t.name());
 }
 protected CoreMessage(String sessionId, MessageType messageType) {
   this.sessionId = sessionId;
   this.messageType = messageType;
   description = "Session Id: " + sessionId + " Type: " + messageType.name();
   updateTimestamp();
 }