Re: Socket communications question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

on 10/13/2006 01:15 PM Jeff Lanzarotta said the following:
> I am trying to get a php web page to communicate with a java
> application with little success...
>
> I can get the php page to send the request to the java application,
> just fine. But when the java app sends the response back, the php page
> does not seem to get it...
>
> As a side note, the java app works just fine if the client is another
> java app, or a C app. Everything is send and received just fine...
>
> From what I can tell in the php page, the
>
> while ($out = socket_read($socket, 2048, PHP_NORMAL_READ))
> {
>   echo $out;
> }
>
> never returns.
>
> Any ideas?

If all you want to is to fetch a page via the GET method, you can use
either fopen/fread or file_get_contents functions passing the URL as
file name.

If what you want is a more complicated HTTP request like using the POST
methods, submit forms, handle cookies and redirection, HTTP
authentication, etc.., you may also want to take a look at this HTTP
client class:

http://www.phpclasses.org/httpclient


-- 

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux