Advertisement

03.11.2008 at 02:21PM PDT, ID: 23233328
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Socket read operation hangs if no data is available

Tags: PHP, Net_Socket, Sockets
I'm new to PHP and have to write something that uses TCP sockets. It is a stand alone application - not linked to a web server. My app is the client and it opens a connection to another application which is the socket server. Ideally I want to be able to run this on either Linux or Windows. At the moment the development environment is Windows. I have been trying to use the Pear Net_Socket package and have had some success. However, all the read functions I have tried fail to return if there is no data to be read - they just hang the whole application. I've tried blocking and non-blocking mode. I've tried getStatus to test if there are any unread_bytes, but nothing works (getStatus always reports unread_bytes=0). If the environment was exclusively Linux, I would use fork to run a parallel thread that just reads the data from the socket - it wouldn't matter if that second thread was stuck there waiting because the primary thread would be able to carry on.

Am I going to have to abandon the Windows option and just work in Linux or is there a way to do multi-threading under Windows? Is there a way to test if data is waiting to be read from the socket in Pear>Net_Socket? Is there an alternative package or set of PHP functions that will open a socket connection and not have this problem?
Start your free trial to view this solution
Question Stats
Zone: Web Development
Question Asked By: feptias
Solution Provided By: RQuadling
Participating Experts: 2
Solution Grade: B
Views: 9
Translate:
Loading Advertisement...
03.11.2008 at 02:54PM PDT, ID: 21100788

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.11.2008 at 11:34PM PDT, ID: 21103523

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.11.2008 at 11:35PM PDT, ID: 21103524

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.12.2008 at 03:39AM PDT, ID: 21104493

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.12.2008 at 06:57AM PDT, ID: 21105978

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.12.2008 at 08:33AM PDT, ID: 21107102

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080236-EE-VQP-29 / EE_QW_EXPERT_20070906