MCPcopy Create free account
hub / github.com/BombusMod/BombusMod / run

Method run

src/main/java/com/alsutton/jabber/JabberStream.java:296–325  ·  view source on GitHub ↗

The threads run method. Handles the parsing of incomming data in its own thread.

()

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 4

parseMethod · 0.95
closeConnectionMethod · 0.95
connectionTerminatedMethod · 0.65
readMethod · 0.45

Tested by

no test coverage detected