alien11689 commented on code in PR #58:
URL: https://github.com/apache/aries-rsa/pull/58#discussion_r3111845557


##########
provider/tcp/src/main/java/org/apache/aries/rsa/provider/tcp/TcpServer.java:
##########
@@ -113,20 +115,24 @@ public void run() {
     }
 
     private void handleConnection(Socket socket) {
-        try (Socket sock = socket;
-             BasicObjectInputStream in = new 
BasicObjectInputStream(socket.getInputStream());
-             ObjectOutputStream out = new 
BasicObjectOutputStream(socket.getOutputStream())) {
+        try (Socket sock = socket; // socket will be closed when done
+             ObjectOutputStream out = new 
BasicObjectOutputStream(socket.getOutputStream());
+             BasicObjectInputStream in = new 
BasicObjectInputStream(socket.getInputStream())) {
+            socket.setTcpNoDelay(true);
             String endpointId = in.readUTF();
             MethodInvoker invoker = invokers.get(endpointId);
             if (invoker == null)
                 throw new IllegalArgumentException("invalid endpoint: " + 
endpointId);
             
in.addClassLoader(invoker.getService().getClass().getClassLoader());
-            handleCall(invoker, in, out);
-        } catch (SocketException se) {
-            return; // e.g. connection closed by client
-        } catch (Exception e) {
-            LOG.warn("Error processing service call", e);
+            while (running) {
+                handleCall(invoker, in, out);
+            }
+        } catch (SocketException | SocketTimeoutException | EOFException se) {
+            return; // e.g. connection closed by client or read timeout due to 
inactivity

Review Comment:
   that's why I mention the debug (or trace) log level ;) 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to