{"record":{"id":"6410246e16d80b37","repo":"Seldaek/monolog","slug":"failed-setting-timeout-with-stream-set-timeout","errorCode":null,"errorMessage":"Failed setting timeout with stream_set_timeout()","messagePattern":"Failed setting timeout with stream_set_timeout\\(\\)","errorType":"exception","errorClass":"UnexpectedValueException","httpStatus":null,"severity":"error","filePath":"src/Monolog/Handler/SocketHandler.php","lineNumber":372,"sourceCode":"    }\n\n    private function createSocketResource(): void\n    {\n        if ($this->isPersistent()) {\n            $resource = $this->pfsockopen();\n        } else {\n            $resource = $this->fsockopen();\n        }\n        if (\\is_bool($resource)) {\n            throw new \\UnexpectedValueException(\"Failed connecting to $this->connectionString ($this->errno: $this->errstr)\");\n        }\n        $this->resource = $resource;\n    }\n\n    private function setSocketTimeout(): void\n    {\n        if (!$this->streamSetTimeout()) {\n            throw new \\UnexpectedValueException(\"Failed setting timeout with stream_set_timeout()\");\n        }\n    }\n\n    private function setStreamChunkSize(): void\n    {\n        if (null !== $this->chunkSize && false === $this->streamSetChunkSize()) {\n            throw new \\UnexpectedValueException(\"Failed setting chunk size with stream_set_chunk_size()\");\n        }\n    }\n\n    private function writeToSocket(string $data): void\n    {\n        $length = \\strlen($data);\n        $sent = 0;\n        $this->lastSentBytes = $sent;\n        while ($this->isConnected() && $sent < $length) {\n            if (0 === $sent) {\n                $chunk = $this->fwrite($data);","sourceCodeStart":354,"sourceCodeEnd":390,"githubUrl":"https://github.com/Seldaek/monolog/blob/57eb1028342134e701e77c617565d51b6e5a2a53/src/Monolog/Handler/SocketHandler.php#L354-L390","documentation":"Error \"Failed setting timeout with stream_set_timeout()\" thrown in Seldaek/monolog.","triggerScenarios":"Thrown at src/Monolog/Handler/SocketHandler.php:372 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"57eb1028342134e701e77c617565d51b6e5a2a53","analyzedAt":"2026-08-17T02:36:30.259Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}