Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    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.

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    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).
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • Users who have thanked Fou-Lu for this post:

    BentoBoxAssault (06-24-2010)

  • #3
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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.

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    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.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •