()
| 149 | } |
| 150 | |
| 151 | public void run() |
| 152 | { |
| 153 | running = true; |
| 154 | |
| 155 | while(running) |
| 156 | { |
| 157 | try |
| 158 | { |
| 159 | String message = connection.readMessage(); |
| 160 | |
| 161 | if(message == null) |
| 162 | { |
| 163 | server.removeClient(this); |
| 164 | disconnect(); |
| 165 | } |
| 166 | else |
| 167 | { |
| 168 | server.handleMessage(message, this); |
| 169 | |
| 170 | if(checkStayAliveTime()) |
| 171 | { |
| 172 | sendKeepAlive(); |
| 173 | } |
| 174 | } |
| 175 | } |
| 176 | catch (SocketTimeoutException e) |
| 177 | { |
| 178 | //e.printStackTrace(); |
| 179 | |
| 180 | if(checkTimeout()) |
| 181 | { |
| 182 | server.removeClient(this); |
| 183 | disconnect(); |
| 184 | } |
| 185 | else |
| 186 | { |
| 187 | sendKeepAlive(); |
| 188 | } |
| 189 | } |
| 190 | catch (IOException e) |
| 191 | { |
| 192 | e.printStackTrace(); |
| 193 | |
| 194 | server.removeClient(this); |
| 195 | disconnect(); |
| 196 | } |
| 197 | } |
| 198 | } |
| 199 | } |
nothing calls this directly
no test coverage detected