Vladsz83 commented on a change in pull request #8881:
URL: https://github.com/apache/ignite/pull/8881#discussion_r666239452



##########
File path: 
modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
##########
@@ -1642,24 +1642,29 @@ Socket createSocket() throws IOException {
         Socket sock = null;
 
         try {
-            if (isSslEnabled())
-                sock = sslSockFactory.createSocket();
-            else
-                sock = new Socket();
+            sock = createSocket0();
 
             sock.bind(new InetSocketAddress(locHost, 0));
 
             configureSocketOptions(sock);
 
             return sock;
-        } catch (IOException e) {
+        }
+        catch (IOException e) {
             if (sock != null)
                 U.closeQuiet(sock);
 
             throw e;
         }
     }
 
+    /**
+     * Creates proper socket.
+     */
+    protected Socket createSocket0() throws IOException {

Review comment:
       To bring socket wrap precisely where it needed witout code duplication. 
Otherwise, we need to duplicate whole TcpDiscoverSpy.createSocket() to 
FailureSimulatingTcpDiscoverySpi. Possibile changes of 
TcpDiscoverSpy.createSocket() will require duplicating them to 
FailureSimulatingTcpDiscoverySpi.createSocket(). With dedicated socket creation 
createSocket0() we don’t care of changes around socket creation and cover SSL 
version.




-- 
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