Improved socket handling?
| From: | Benjamin Smith | Date: | Wed, 14 Dec 2005 09:17:20 +0000 |
| Subject: | Improved socket handling? | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-6376@lists.php.net to get a copy of this message | ||
Is there a way to improve socket handling?
For example:
<?
$fp=fopen($url, 'r');
while ($line=fgets($fp, 1024))
{
// do something in gtk.
}
?>
The problem here is that the screen doesn't update while PHP is waiting for
data to come in from $fp. You can do somewhat better with fsockopen, but it's
still not a panacea.
What I'm picturing is something like:
<?
$fp=fopen($url, 'r');
$fp->Connect('data_retrieve', 'process_data');
Function Process_Data($line)
{
// do something with the data in $line...
}
?>
Yeah, it's pseudo-code.Can this be done? Is there any mechanism for doing
this?
-Ben
--
"The best way to predict the future is to invent it."
- XEROX PARC slogan, circa 1978