diff --git a/src/FreeDSx/Socket/Socket.php b/src/FreeDSx/Socket/Socket.php
index <HASH>..<HASH> 100644
--- a/src/FreeDSx/Socket/Socket.php
+++ b/src/FreeDSx/Socket/Socket.php
@@ -161,7 +161,7 @@ class Socket
      */
     public function isConnected() : bool
     {
-        return \is_resource($this->socket);
+        return $this->socket !== null && !@\feof($this->socket);
     }
 
     /**
diff --git a/tests/spec/FreeDSx/Socket/SocketSpec.php b/tests/spec/FreeDSx/Socket/SocketSpec.php
index <HASH>..<HASH> 100644
--- a/tests/spec/FreeDSx/Socket/SocketSpec.php
+++ b/tests/spec/FreeDSx/Socket/SocketSpec.php
@@ -56,4 +56,13 @@ class SocketSpec extends ObjectBehavior
     {
         $this::udp('8.8.8.8', ['port' => 53])->getOptions()->shouldHaveKeyWithValue('buffer_size', 65507);
     }
+
+    function it_should_tell_whether_or_not_it_is_connected()
+    {
+        $this->beConstructedThrough('tcp', ['www.google.com', ['port' => 80]]);
+
+        $this->isConnected()->shouldBeEqualTo(true);
+        $this->close();
+        $this->isConnected()->shouldBeEqualTo(false);
+    }
 }
Correctly determine if a socket is connected or not.