Skip to content

Commit 0b99866

Browse files
committed
watch for selector exceptions.
1 parent aee0184 commit 0b99866

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

AndroidAsync/src/com/koushikdutta/async/AsyncServer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,10 @@ private static void run(final AsyncServer server, final SelectorWrapper selector
608608
runLoop(server, selector, queue);
609609
}
610610
catch (ClosedSelectorException e) {
611+
StreamUtility.closeQuietly(selector.getSelector());
612+
}
613+
catch (AsyncSelectorException e) {
614+
StreamUtility.closeQuietly(selector.getSelector());
611615
}
612616
// see if we keep looping, this must be in a synchronized block since the queue is accessed.
613617
synchronized (server) {

0 commit comments

Comments
 (0)