Code Duplication    Length = 4-4 lines in 2 locations

src/Generics/Socket/ClientSocket.php 1 location

@@ 54-57 (lines=4) @@
51
        if (!is_resource($this->handle)) {
52
            throw new SocketException("Socket is not available");
53
        }
54
        if (! @socket_connect($this->handle, $this->endpoint->getAddress(), $this->endpoint->getPort())) {
55
            $code = socket_last_error($this->handle);
56
            throw new SocketException(socket_strerror($code), array(), $code);
57
        }
58
        $this->conntected = true;
59
    }
60

src/Generics/Socket/ServerSocket.php 1 location

@@ 76-79 (lines=4) @@
73
     */
74
    private function bind()
75
    {
76
        if (! @socket_bind($this->handle, $this->endpoint->getAddress(), $this->endpoint->getPort())) {
77
            $code = socket_last_error($this->handle);
78
            throw new SocketException(socket_strerror($code), array(), $code);
79
        }
80
    }
81
82
    /**