The threads run method. Handles the parsing of incomming data in its own thread.
()
| 294 | * own thread. |
| 295 | */ |
| 296 | public void run() { |
| 297 | try { |
| 298 | XMLParser parser = new XMLParser(this); |
| 299 | connected = true; |
| 300 | |
| 301 | byte cbuf[] = new byte[32768]; |
| 302 | |
| 303 | while (connected) { |
| 304 | int length = iostream.read(cbuf); |
| 305 | if (length == 0) { |
| 306 | try { |
| 307 | Thread.sleep(100); |
| 308 | } catch (Exception e) { |
| 309 | } |
| 310 | continue; |
| 311 | } |
| 312 | parser.parse(cbuf, length); |
| 313 | } |
| 314 | |
| 315 | //dispatcher.broadcastTerminatedConnection( null ); |
| 316 | } catch (Exception e) { |
| 317 | if (StaticData.Debug) { |
| 318 | e.printStackTrace(); |
| 319 | } |
| 320 | if (listener != null) { |
| 321 | listener.connectionTerminated(e); |
| 322 | } |
| 323 | } |
| 324 | closeConnection(); |
| 325 | } |
| 326 | |
| 327 | private void closeConnection() { |
| 328 | try { |
nothing calls this directly
no test coverage detected