summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorGurmeen Bindra <gurmeen.bindra@isode.com>2013-08-09 09:50:29 (GMT)
committerGurmeen Bindra <gurmeen.bindra@isode.com>2013-08-09 10:00:00 (GMT)
commit21c49ad96762ef3af27dd043a044e37b8ef1c22e (patch)
treebc70af232b16f10858306f8ee2e06024cf5f9a95 /src/com
parent4f743d361c2e84420d02d9c9d10304b7184b3170 (diff)
downloadstroke-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/com')
-rw-r--r--src/com/isode/stroke/network/JavaConnection.java1
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? */
}