diff --git a/src/main/java/examples/TryWithResources.java b/src/main/java/examples/TryWithResources.java
index <HASH>..<HASH> 100644
--- a/src/main/java/examples/TryWithResources.java
+++ b/src/main/java/examples/TryWithResources.java
@@ -1,5 +1,6 @@
 package examples;
 
+import javax.net.SocketFactory;
 import me.legrange.mikrotik.ApiConnection;
 import me.legrange.mikrotik.MikrotikApiException;
 
@@ -16,7 +17,7 @@ public class TryWithResources  {
     }
 
     private void test() throws MikrotikApiException, InterruptedException {
-        try (ApiConnection con = ApiConnection.connect(Config.HOST, ApiConnection.DEFAULT_PORT, 2000)) {
+        try (ApiConnection con = ApiConnection.connect(SocketFactory.getDefault(), Config.HOST, ApiConnection.DEFAULT_PORT, 2000)) {
             con.login(Config.USERNAME, Config.PASSWORD);
             con.execute("/user/add name=eric");
         }
Updated example for removed connect() methods