()
| 104 | } |
| 105 | |
| 106 | public void run() { |
| 107 | while(flag_exit){ |
| 108 | try { |
| 109 | chat_re = dis.readUTF(); |
| 110 | } catch (IOException e) { |
| 111 | flag_exit = false; |
| 112 | if(!chat_re.contains("@serverexit")){ |
| 113 | chat_re = null; |
| 114 | } |
| 115 | } |
| 116 | if(chat_re != null){ |
| 117 | if(chat_re.contains("@clientThread")){ |
| 118 | int local = chat_re.indexOf("@clientThread"); |
| 119 | setThreadID(Integer.parseInt(chat_re.substring(0, local))); |
| 120 | try { |
| 121 | dos.writeUTF(username + "@login" + getThreadID() + "@login"); |
| 122 | } catch (IOException e) { |
| 123 | e.printStackTrace(); |
| 124 | } |
| 125 | }else{ |
| 126 | if(chat_re.contains("@userlist")){ |
| 127 | c_chatFrame.setDisUsers(chat_re); |
| 128 | }else{ |
| 129 | if(chat_re.contains("@chat")){ |
| 130 | c_chatFrame.setDisMess(chat_re); |
| 131 | }else{ |
| 132 | if(chat_re.contains("@serverexit")){ |
| 133 | c_chatFrame.closeClient(); |
| 134 | }else{ |
| 135 | if(chat_re.contains("@single")){ |
| 136 | c_chatFrame.setSingleFrame(chat_re); |
| 137 | } |
| 138 | } |
| 139 | } |
| 140 | } |
| 141 | } |
| 142 | } |
| 143 | } |
| 144 | } |
| 145 | public void transMess(String mess) { |
| 146 | try { |
| 147 | dos.writeUTF(username + "@chat" + getThreadID() + "@chat"+ mess + "@chat"); |
nothing calls this directly
no test coverage detected