stream_set_timeout issue with ssl connection
| From: | Sebastian Muszytowski | Date: | Wed, 08 Apr 2009 17:38:11 +0000 |
| Subject: | stream_set_timeout issue with ssl connection | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-291236@lists.php.net to get a copy of this message | ||
Hello everyone,
i have an issue with stream_set_timeout and ssl.
I've written a php irc newsbot and my code looks like this:
[...]
while (!feof($con['socket']))
{
stream_set_timeout($con['socket'], $CONFIG['qtime']);
[...]
I need this timeout because i want to read the news every X seconds from the Database.
I use
$con['buffer'] = trim(fgets($con['socket'], 4096));
to get the data. If i don't use the stream_set_timeout the bot would wait until it recieves data.
In fact this solution works, but only if i connect with fsockopen to a non ssl connection.
If i use a ssl connection steam_set_timeout seems to be ignored.
Any clues or workarounds?
Sebastian
PS: You can download the whole code on http://muzybot.de/phpircbot.tar.gz or http://muzybot.de/phpircbot.zip