Revisão | 25e309d6731ce6f98bf088192a10ae3712a1d114 (tree) |
---|---|
Hora | 2021-11-11 21:27:10 |
Autor | sebastian_bugiu |
Commiter | sebastian_bugiu |
Reverted stupid bug because of robovm compiling stuff wrong.
@@ -353,7 +353,9 @@ | ||
353 | 353 | shutdown = false; |
354 | 354 | while (!shutdown) { |
355 | 355 | try { |
356 | +// System.out.println("Calling update"); | |
356 | 357 | update(250); |
358 | +// System.out.println("Update called"); | |
357 | 359 | } catch (IOException ex) { |
358 | 360 | if (TRACE) { |
359 | 361 | if (isConnected) |
@@ -409,17 +411,29 @@ | ||
409 | 411 | |
410 | 412 | public void close () { |
411 | 413 | super.close(); |
414 | +// System.out.println("close()"); | |
412 | 415 | synchronized (updateLock) { // Blocks to avoid a select while the selector is used to bind the server connection. |
413 | - } | |
414 | - // Select one last time to complete closing the socket. | |
415 | - if (!isClosed) { | |
416 | - isClosed = true; | |
417 | - selector.wakeup(); | |
418 | - try { | |
419 | - selector.selectNow(); | |
420 | - } catch (IOException ignored) { | |
416 | + | |
417 | + // Select one last time to complete closing the socket. | |
418 | + if (!isClosed) { | |
419 | + isClosed = true; | |
420 | +// System.out.println("Calling wakeup() from close()"); | |
421 | + selector.wakeup(); | |
422 | +// try { | |
423 | +// Thread.sleep(500); | |
424 | +// } catch (InterruptedException e) { | |
425 | +// e.printStackTrace(); | |
426 | +// } | |
427 | + try { | |
428 | +// System.out.println("Calling selectNow() from close()"); | |
429 | + selector.selectNow(); | |
430 | +// System.out.println("Called selectNow() from close()"); | |
431 | + } catch (IOException ignored) { | |
432 | + ignored.printStackTrace(); | |
433 | + } | |
421 | 434 | } |
422 | 435 | } |
436 | +// System.out.println("Exiting close()"); | |
423 | 437 | } |
424 | 438 | |
425 | 439 | /** Releases the resources used by this client, which may no longer be used. */ |
@@ -575,12 +575,13 @@ | ||
575 | 575 | } |
576 | 576 | |
577 | 577 | synchronized (updateLock) { // Blocks to avoid a select while the selector is used to bind the server connection. |
578 | - } | |
579 | - // Select one last time to complete closing the socket. | |
580 | - selector.wakeup(); | |
581 | - try { | |
582 | - selector.selectNow(); | |
583 | - } catch (IOException ignored) { | |
578 | + | |
579 | + // Select one last time to complete closing the socket. | |
580 | + selector.wakeup(); | |
581 | + try { | |
582 | + selector.selectNow(); | |
583 | + } catch (IOException ignored) { | |
584 | + } | |
584 | 585 | } |
585 | 586 | } |
586 | 587 |