Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-22-2010, 12:04 AM   PM User | #1
BentoBoxAssault
New to the CF scene

 
Join Date: Jun 2010
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
BentoBoxAssault is an unknown quantity at this point
Default stream timeout

Hey guys, I have a short and hopefully simple question. I know that there is a default_socket_timeout parameter in php.ini that specifies the maximum time for opening a socket.
I also know that the timeout for streams can be set with stream_set_timeout. Is there a default value for the timeout of a stream and if so, what is it and can it be set in php.ini?

Thanks in advance.
BentoBoxAssault is offline   Reply With Quote
Old 06-22-2010, 03:24 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
I believe that any socket based stream will take the timeout enforced by the default_socket_timeout, but offhand I've never tried this so I cannot verify.
Ah, here's a list of them too: http://php.net/manual/en/transports.php

So, I believe if you have set up a stream using any of the layers used in the above link, that those are all considered to be socketed streams and will take the default_socket_timeout. If not, they will of course be terminated by your max execution time instead.
This smells like something that needs a test. Sadly, the api isn't overly clear about this (or could just be listed where I wouldn't think to look :P).
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Users who have thanked Fou-Lu for this post:
BentoBoxAssault (06-24-2010)
Old 06-24-2010, 12:05 AM   PM User | #3
BentoBoxAssault
New to the CF scene

 
Join Date: Jun 2010
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
BentoBoxAssault is an unknown quantity at this point
Thanks! I assumed the same but, as you say, the documentation is not clear about this. It is strange that this is not better documented, since this seems quite important.
BentoBoxAssault is offline   Reply With Quote
Old 06-24-2010, 03:04 PM   PM User | #4
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
I have to agree. Unless I'm totally out to lunch on that, I would expect that there be an entry within the streams section indicating if there is a default timeout, and if there is how its enforced. I make the assumption its the same as with the sockets for socketed streams, but we shouldn't have to make this assumption.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Tags
socket, streams, timeout

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:34 PM.


Advertisement
Log in to turn off these ads.