Re: [PHP] Server-Client connection via TCP port with PHP

2005-08-09 Thread Marco Tabini
Hi Eli--

On 8/9/05 9:40 PM, "Eli" <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> I got a PHP program on my server. I want to open a live TCP port
> connection between my server to a client (client is developed in .NET,
> not regular HTTP browser).
> How can I do this using PHP?

You can use the socket functions in conjunction with TCP wrappers.

For example, take a look at fsockopen() in the manual:

http://ca.php.net/fsockopen

The resulting resource can be used with fwrite() and fread() and the likes
as if it were a file resource.

For more complex applications, you can use the actual socket API:

http://beeblex.com/manual/ref.sockets.html?s=man%3Asocket

Finally (since you mention you're connecting to a .Net app), maybe what you
need is a web service protocol like SOAP, in which case if you're using PHP
5 there is a built-in extension, whereas PHP 4 requires you to use a
userland library like the one provided by PEAR:

http://pear.php.net/package/soap/redirected

Cheers,


Marco

-- 
Marco Tabini
President & CEO

Marco Tabini & Associates, Inc.
28 Bombay Ave.
Toronto, ON M3H 1B7
Canada

Phone: +1 (416) 630-6202
Fax: +1 (416) 630-5057

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



Re: [PHP] Server-Client connection via TCP port with PHP

2005-08-09 Thread Richard Davey
Hello Eli,

Wednesday, August 10, 2005, 2:40:07 AM, you wrote:

E> I got a PHP program on my server. I want to open a live TCP port
E> connection between my server to a client (client is developed in
E> .NET, not regular HTTP browser). How can I do this using PHP?

Look in the manual at the quite considerable chapter on "Socket
Functions".

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 Zend Certified Engineer
 "I do not fear computers. I fear the lack of them." - Isaac Asimov

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



[PHP] Server-Client connection via TCP port with PHP

2005-08-09 Thread Eli

Hi,

I got a PHP program on my server. I want to open a live TCP port 
connection between my server to a client (client is developed in .NET, 
not regular HTTP browser).

How can I do this using PHP?

-thanks in advance!

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