private function setSocketTimeout(): self
    {
        $timeCalculation = $this->connectionParameters->getKeepAlivePeriod() * 1.5;
        $seconds = (int)floor($timeCalculation);
        stream_set_timeout($this->socket, $seconds, (int)($timeCalculation - $seconds) * 1000);

        return $this;
    }