issues with 'stream_socket_client()' and/or 'pfsockopen()'

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

 




Hello,

I am involved in a project, which has a C++ server side, and a web PHP client side. We wish to develop consistent php socket connection with the C++ server side. Therefore we have been trying to use either 'stream_socket_client()' or 'pfsockopen()' in our PHP code.

However, we have hit obstacles in using either 'stream_socket_client()' or 'pfsockopen()', as described in the following:

For example, by using the php calls 'socket_create()', 'socket_connect()', 'socket_write()', and 'socket_read()', our php program is able to send a particular client enquiry, and then get back server data of 4196 bytes through socket connection.

However, if instead, we use the php calls 'stream_context_create()', 'stream_socket_client()', 'fwrite()', and 'fread()', we will almost always get back incomplete server response data, say 2500 bytes, through the socket connection.

And the similar problems if we use the php calls 'pfsockopen()', 'fwrite()', and 'fread()'.

Such problems are first found on windows, and then on Linux.

We would very much appreciate it if any suggestions on using 'stream_socket_client()' or 'pfsockopen()' correctly and successfully, and further on implementing persistent php client socket successfully. Thanks a lot!

Regards,

Hong Yu



--
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