protected function checkSocketErrors() {
        $code = \socket_last_error($this->socket);
        \socket_clear_error($this->socket);
        
        if($code !== \SOCKET_EWOULDBLOCK) {
            throw new \DomainException(\socket_strerror($code));
        }
    }