Skip to content

Commit dc90075

Browse files
authored
Merge pull request #877 from wso2/revert-876-5.3.x
Revert "Handle: Socket Timeout Exception"
2 parents a1bcde9 + 2d8c371 commit dc90075

File tree

1 file changed

+2
-25
lines changed
  • components/data-bridge/org.wso2.carbon.databridge.receiver.binary/src/main/java/org/wso2/carbon/databridge/receiver/binary/internal

1 file changed

+2
-25
lines changed

components/data-bridge/org.wso2.carbon.databridge.receiver.binary/src/main/java/org/wso2/carbon/databridge/receiver/binary/internal/BinaryDataReceiver.java

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import java.io.*;
4343
import java.net.ServerSocket;
4444
import java.net.Socket;
45-
import java.net.SocketTimeoutException;
4645
import java.nio.ByteBuffer;
4746
import java.security.KeyManagementException;
4847
import java.security.KeyStore;
@@ -211,23 +210,12 @@ public BinarySecureEventServerAcceptor(ServerSocket serverSocket) {
211210
@Override
212211
public void run() {
213212
while (true) {
214-
Socket socket = null;
215213
try {
216-
socket = this.serverSocket.accept();
214+
Socket socket = this.serverSocket.accept();
217215
socket.setSoTimeout(binaryDataReceiverConfiguration.getSocketTimeout());
218216
sslReceiverExecutorService.submit(new BinaryTransportReceiver(socket));
219-
} catch (SocketTimeoutException socketTimeoutException) {
220-
log.error("Socket read timed out for client", socketTimeoutException);
221217
} catch (IOException e) {
222218
log.error("Error while accepting the connection. ", e);
223-
} finally {
224-
if (socket != null && !socket.isClosed()) {
225-
try {
226-
socket.close();
227-
} catch (IOException ex) {
228-
log.error("Error while closing socket", ex);
229-
}
230-
}
231219
}
232220
}
233221
}
@@ -243,23 +231,12 @@ public BinaryEventServerAcceptor(ServerSocket serverSocket) {
243231
@Override
244232
public void run() {
245233
while (true) {
246-
Socket socket = null;
247234
try {
248-
socket = this.serverSocket.accept();
235+
Socket socket = this.serverSocket.accept();
249236
socket.setSoTimeout(binaryDataReceiverConfiguration.getSocketTimeout());
250237
tcpReceiverExecutorService.submit(new BinaryTransportReceiver(socket));
251-
} catch (SocketTimeoutException socketTimeoutException) {
252-
log.error("Socket read timed out for client", socketTimeoutException);
253238
} catch (IOException e) {
254239
log.error("Error while accepting the connection. ", e);
255-
} finally {
256-
if (socket != null && !socket.isClosed()) {
257-
try {
258-
socket.close();
259-
} catch (IOException ex) {
260-
log.error("Error while closing socket", ex);
261-
}
262-
}
263240
}
264241
}
265242
}

0 commit comments

Comments
 (0)