Re: Active Connections

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

 



On Mon, October 23, 2006 5:21 pm, Prathaban Mookiah wrote:
> I am trying to develop a web based controller for a robot. The robot
> has an
> embedded telnet deamon and it is controlled primarily through issuing
> commands on this port. I am planning to implement this system with PHP
> on the
> server side.

Cool!

> Ideally what I would like to do is have two persistent active
> connections:
> one between the browser and the webserver, and the other between the
> webserver and the robot controller. When the user opens the interface
> for the
> first time in his browser, the 2 connections are initiated and they
> have to
> remain active till the session is closed. In the simplest case, a
> single
> servers side PHP script would manage both these connections. I know
> there is
> no way I can keep an active connection between the browser and server
> using
> HTTP. I guess I will have to go for something like applets.

You could consider using PHP to run Java to run the connection part,
just so it can be a "bridge" to keep that connection open... Always
wanted to try this, but never got around to it...
[keep reading]

> My question is, is there any other way this can be done in PHP. At
> least is
> there a way I can keep the web server - controller connection alive
> even
> after the script finishes executing and then use that connection the
> next
> time the user tries to access the controller through the webserver.

You can't force the web server to keep its connection open, but you
could write your own custom "robot server" with http://php.net/sockets

This is the way I personally would go, as I'd waste about a thousand
hours fighting with Java and never would get it to work.

> Plus the controller outputs have to be automatically updated in the
> browser
> window. Is an Applet-PHP Script combination a good choice for this
> system. Or
> are MS activex controls good choice in the browser side?

On the "browser" side you've got choices like PHP-GTK and Ming that
might work out well for this kind of thing.

Ming/Flash won't keep the connection open reliably, but you at least
have Good Odds it will stick around, so you can program for it to be
"mostly there, except when it's not" which you have to do any way for
dropped connections and other problems.

MS ActiveX avoid like the plague, personally, as they don't work on my
boxes, and aren't installed on the boxes where they would work if I
was willing to install them, but I'm not.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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