开发者

simple python chat server by rooms

开发者 https://www.devze.com 2023-02-22 03:16 出处:网络
I am trying to write a simple chat server which sends comman开发者_开发技巧ds from ajax to fsockopen to the daemon. The daemon if command is listen will hold the request in a array with what room it h

I am trying to write a simple chat server which sends comman开发者_开发技巧ds from ajax to fsockopen to the daemon. The daemon if command is listen will hold the request in a array with what room it has assigned. Then when an command comes in as msg it sends that message out to everyone who is in the listening array list for that room. Can I get some good tutorials or examples of how this would work?

Thanks

-- Added after the first answer posted --

To help any further answers. I am using jquery ajax getjson call to a script which php -> fsockopen to the daemon. I currently have a simifunctional copy of the daemon in php but think this is better suited if written in python. Also, I am still fairly new to socket tech and am still trying to understand the flow. So comet solution.


The App Engine Channel API probably does what you want: http://code.google.com/appengine/docs/python/channel/overview.html

"Comet" is the more general term to search for if you don't want to run on App Engine. Basically you need some kind of server-side push, which (until websockets is finally ready) must be faked using a variety of hacks.

0

精彩评论

暂无评论...
验证码 换一张
取 消