Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

PHP SSL Socket Fgets Blocking

Posted on 2011-03-20
2
548 Views
Last Modified: 2012-05-11
Hi

I have PHP SSL socket open using fsockopen("ssl://mysite.com") etc.

Then I have this:

$this->header = fgets($fh, 1024);

I added showing runtime code above and below of this line and there is a lot of difference and this code causes error.

Before:
0.71457600 1300632013
After that line:
0.29207500 1300632254

These 2 values are output of microtime

How can I make my code not to wait for fgets if there is no 1024 byte available to read?

Please advice

Thanks
0
Comment
Question by:CSecurity
2 Comments
 
LVL 16

Accepted Solution

by:
hankknight earned 500 total points
ID: 35278527
Your idea cannot be implemented with fgets.  Consider using cURL instead of fgets.  The level of customization and control is much greater with cURL than it is with fgets.

http://php.net/manual/en/book.curl.php
0
 
LVL 17

Author Closing Comment

by:CSecurity
ID: 35813860
Solved problem. Error was somewhere else
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question