You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Remove unnecessary shutdownInput call in TCPNetworkModule#stop
TCPNetworkModule#stop calls shutdownInput before calling close.
The comment says it is for enabling SSL session resumption,
but close is never called if the socket is SSLSocket as shutdownInput always throws exception.
- Fix CommsReceiver to properly use `runningSemaphore` for stopping the receiver task
In `run()` method, `runningSemaphore` is inproperly released on every while loop run.
This change moves `runningSemaphore.release()` to outside of while loop.
Signed-off-by: Akira Saito <saiaki@jp.ibm.com>
Copy file name to clipboardExpand all lines: org.eclipse.paho.client.mqttv3/src/main/java/org/eclipse/paho/client/mqttv3/internal/TCPNetworkModule.java
-19Lines changed: 0 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -102,25 +102,6 @@ public OutputStream getOutputStream() throws IOException {
102
102
*/
103
103
publicvoidstop() throwsIOException {
104
104
if (socket != null) {
105
-
// CDA: an attempt is made to stop the receiver cleanly before closing the socket.
106
-
// If the socket is forcibly closed too early, the blocking socket read in
107
-
// the receiver thread throws a SocketException.
108
-
// While this causes the receiver thread to exit, it also invalidates the
109
-
// SSL session preventing to perform an accelerated SSL handshake in the
110
-
// next connection.
111
-
//
112
-
// Also note that due to the blocking socket reads in the receiver thread,
113
-
// it's not possible to interrupt the thread. Using non blocking reads in
114
-
// combination with a socket timeout (see setSoTimeout()) would be a better approach.
115
-
//
116
-
// Please note that the Javadoc only says that an EOF is returned on
117
-
// subsequent reads of the socket stream.
118
-
// Anyway, at least with Oracle Java SE 7 on Linux systems, this causes a blocked read
119
-
// to return EOF immediately.
120
-
// This workaround should not cause any harm in general but you might
0 commit comments