0

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

Liad Livnat
  • 7,435
  • 16
  • 60
  • 98

1 Answers1

1

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!

hanenbro
  • 604
  • 7
  • 16
  • thank you for you comment, i agree that smartfox is overkill but, pulling from server is not the right way to do it, i need to find a way to push changes from server to client with a simple method – Liad Livnat Sep 03 '13 at 04:37