1 package com.quikj.server.framework; 2 3 public class AceIPCDiscMessage implements AceIPCMessageInterface 4 { 5 6 10 11 protected AceIPCDiscMessage (byte[] msg, int length) throws AceException 13 { 14 message = msg; 15 msgLength = length; 16 } 17 18 protected AceIPCDiscMessage () 20 { 21 msgLength = MSG_HEADER_LENGTH; 22 message = new byte [msgLength]; 23 24 message [MSG_TYPE_OFFSET] = DISCONNECT_MSG; 26 } 27 28 public int getIPCMsgType() 29 { 30 return message[MSG_TYPE_OFFSET]; 31 } 32 33 public int getLength() 34 { 35 return msgLength; 36 } 37 38 public String traceIPCMessage(boolean entire_message) 39 { 40 if (entire_message == true) 41 { 42 return (AceIPCMessage.dumpRawBytes (message, 0, msgLength)); 43 } 44 else 45 { 46 return (new String ("DISCONNECT")); 47 } 48 } 49 50 public byte[] getBytes() 51 { 52 return message; 53 } 54 55 private static final int MSG_HEADER_LENGTH = 1; 56 57 private byte[] message; 58 private int msgLength; 59 } 60 | Popular Tags |