Details
-
Bug
-
Resolution: Fixed
-
Low
-
2.4.1
-
None
Description
We initialise the control port as follows:
mSvr = new ServerSocket(mBind.getPort(), 0, mBind.getInetAddress());
That opens the server socket with a backlog of 0 which means requests will not be queued. A backlog of 0, causes the JVM to use the default backlog value of 50, which means requests are queued correctly.
That means if for example you issue multiple rescan requests in quick succession you may end up getting connection refused errors:
Problem connecting to 127.0.0.1:8059 : Connection reset java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:185) at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:282) at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:324) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:176) at java.io.InputStreamReader.read(InputStreamReader.java:184) at java.io.BufferedReader.fill(BufferedReader.java:153)
Perhaps we should increase the backlog.