diff options
author | Gurmeen Bindra <gurmeen.bindra@isode.com> | 2013-08-09 09:50:29 (GMT) |
---|---|---|
committer | Gurmeen Bindra <gurmeen.bindra@isode.com> | 2013-08-09 10:00:00 (GMT) |
commit | 21c49ad96762ef3af27dd043a044e37b8ef1c22e (patch) | |
tree | bc70af232b16f10858306f8ee2e06024cf5f9a95 /src | |
parent | 4f743d361c2e84420d02d9c9d10304b7184b3170 (diff) | |
download | stroke-21c49ad96762ef3af27dd043a044e37b8ef1c22e.zip stroke-21c49ad96762ef3af27dd043a044e37b8ef1c22e.tar.bz2 |
Close selector with socketchannel
I left MLC which is an XMPP Client running overnight and noticed "Too many open files"
error when trying to stop/start xmpp server. On doing an "lsof | grep java", I noticed
a large number of open sockets which was presumably the cause of this error.
After this patch, the lsof command shows a constant number of open sockets.
Test-information:
tested on centos vm by doing "lsof | grep java " wc-l"-open sockets do not increase.
Change-Id: I7ddff78a1efb005177427fda21f1d0b92d8ed7cc
Reviewer: Kevin Smith <kevin.smith@isode.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/com/isode/stroke/network/JavaConnection.java | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/com/isode/stroke/network/JavaConnection.java b/src/com/isode/stroke/network/JavaConnection.java index efbf54f..2069e33 100644 --- a/src/com/isode/stroke/network/JavaConnection.java +++ b/src/com/isode/stroke/network/JavaConnection.java @@ -132,6 +132,7 @@ public class JavaConnection extends Connection implements EventOwner { if(socketChannel_ != null) { try { socketChannel_.close(); + selector_.close(); } catch (IOException ex) { /* Do we need to return an error if we're already trying to close? */ } |