private function getStreamSocketClient()
    {
        $stream_socket_client = stream_socket_client(
            $this->params['endpoint'],
            $errno,
            $errstr,
            30,
            STREAM_CLIENT_CONNECT | STREAM_CLIENT_PERSISTENT,
            $this->getStreamContext()
        );

        if ($stream_socket_client === false) {
            throw new PushException('An error occurred while trying to contact APNS server.');
        }

        return $stream_socket_client;
    }