Home  |  Linux  | Mysql  | PHP  | XML
From:Nathan Rixham Date:Sun Feb  7 16:06:39 2010
Subject:Re: Issue with blocked socket stream
Phani Raju wrote:
> I am trying to open a blocking stream using fsockopen. I want to write and read XML input/output from a server. After opening the steam I will send a XML request to server using the stream. Once this request is sent, I want to keep listening on the port indefinitely.
>
> I tried using blocking stream for this with a huge timeout. But had no success as it was not waiting for such a long period.
>
> Code:
> $parser = xml_parser_create("UTF-8");
> if($stream = @fsockopen($host, $port, $errorno, $errorstr, $timeout)) {
> stream_set_blocking($stream, 1);
> stream_set_timeout($stream, TIMEOUT);
> fwrite($stream, $xml."n");

fwrite($stream, $xml."n") should probably be fwrite($stream, $xml."\n") ?
Navigate in group php.general at sever news.php.net
Previous Next


Your recent visits
Re: [PHP] Re: PHP in HTML code
Re: [PHP] Spreadsheet_Excel_Reader problem
pecl install geoip doesnt work. Warning: opendir(/var/tmp/pear-build-root/install-geoip-1.0.7//var/www/pear):
=?utf-8?B?UmU6IFJlOiBJc3N1ZSB3aXRoIGJsb2NrZWQgc29ja2V0IHN0cmVhbQ==?=
cvs: pecl /llvm INSTALL



  
© No Copyright
You are free to use Anything, but please consult your advocate before doing so as this website
also list content from other sources which may be copyrighted.
Site Maintained by Zareef Ahmed
Powered By PHP Consultants