message = message.replace("\r\n", "");
System.out.println("trimmed new line");
}
String[] split = message.split("\\|");
int i = Integer.parseInt(split[0]);
MessageType t = MessageType.values()[i];
for (MessageCallback c : messageCallbacks) {
c.onMessage(split[1], t);
}
}