1 | // Tango api `receive' implementation |
2 | public void receive (AppEventMessage em) { |
3 | if (em.getType() == Const.CONTROL) { // checking for message type |
4 | CAppAnswerEventMessage msg = (CAppAnswerEventMessage) em; |
5 | //The above is conversion to control message |
6 | if (msg.getAnswerType() == CAConsts.USERNAME) |
7 | un = msg.getUserName(); //extraction of information |
8 | } |
9 | else { //DATA type message |
10 | String msg=new String (em.getData(),0,0,em.getLen()); |
11 | //extraction of data |
12 | ta.appendText(msg); |
13 | } |
14 | } |