Looking for easy way to create push notification between PHP to flash (AS3)

689 Views Asked by At

I'm trying to find an easy way to implement push notification between PHP and Flash (AS3). The flow is as following : i get a message to my external API -> i need to update my client regarding the changes he need to do without do pulling.

I know SmartFox server has the ability to do that but SmartFox is java based, but don't understand if i can connect to smart fox from php, and i can how would i do that.

If anyone can help, please do.

SmartFox Docs

1

There are 1 best solutions below

1
On

I think that a SmartFox installation might be overkill for a notifications system alone. The SmartFox server maintains a socket connection with the SWF client, and pushes+pulls data that way, so a simpler solution would be to run a PHP socket server, with an AS3 socket client implementation.

There are a few examples of each end of this setup around the web, and some that provide a sample PHP server and AS3 client in combination, such as this one: http://www.kilometer0.com/blog/code/php-xml-socket-server/

Personally, depending on the amount of likely traffic and the degree of responsiveness needed, I might prefer to poll a regular PHP script from the client on an interval of a few seconds, and perhaps reduce these if there's been no user input for a while. That's certainly easier, but you specifically asked for no pulling, so feel free to disregard that!