1

I wanted to know if somebody could explain in somewhat simple terms how I could get started with comet. I am on a shared host environment.

What exactly are my possibillity's?

From what I have read here sofar, is that php is not the best option., because it is run as a one process per request instead off thread. On another, they talk about sockets.

I have also read about facebook and that they run there own comet server written in erlang, but they still have a php website. So how exactly does that work then?

I have read alot off stuff now, but it is still a bit vague on what is actually possible in my situation. Running a php script that is a client off a comet server?? That is not saying how it keeps a longlasting open connection! (just throwing in some comments from other posts)

thanks, Richard

3
  • Check my question too... Commented Oct 27, 2009 at 21:43
  • Thanks, without reading all the links in it. It suggests some configuring is neccesary on the webserver. I don´t know how far you had to go, but I am on a shared host. In that respect my options are limited, I think. On a sidenote, did you get it all up and running to your satisfactory? Commented Oct 27, 2009 at 21:56
  • i tried meteor on own server environment and works fine, couldn't try the others, but as far as i get from other comments you need a chat on your page, for that you dont need to have comet just make frequent calls and collect responses and update your chat messages on browser. This sounds like traffic intensive operation but if it is a low traffic webpage it won't make too big difference. Commented Oct 27, 2009 at 23:40

2 Answers 2

2

You can use PHP to reproduce the Comet behavior. Like you said PHP isn't the best choice because of a lot of memory management issues that are still widely there.

However for small scale purposes (low-traffic) PHP will work just fine.

There's a lot of information on the web about Comet and how to use it with languages such as Python or Erlang (especially good because of its optimal concurrency behavior, but frankly I don't know much about it).

If you want to try out Python there's a good question/answer on SO: Python Comet Server

Sign up to request clarification or add additional context in comments.

4 Comments

Facebook's gui is written in PHP (they probably only use the templating engine) but it doesn't mean their Chat stuff is. You can use the language that is most appropriate for the job, they chose Erlang, you can choose anything else, you don't have to rewrite your site.
thanks, thats why I put the facebook comment in it, because that seemed to contradict the general opinion about php. Another thing is the use off flash, but that's not really what I wanted to pursue. If you talk about other languages, then that would imply that I rewrite the whole php-mysql website in another language, or not?
sorry, I am confusing myself now. So asking a php script to open a longlasting connection is not the way to go, because the php engine is not optimized for this kind off usage. So, is it then possible to make an ajaxcall to get to the cometserver somehow, and avoiding the use off php? in other words, step off to some java or python script. Ok, now I officially don´t know what I am talking about anymore. How do you get to some other language and use it in the php site?
If I were building a chat system, I don't think I'd want to use FB as my goal. Their chat implementation is surprisingly broken relative to other functionalities on the website
2

A simple solution is to find a SaaS comet provider, such as the one we host at Frozen Mountain, WebSync On-Demand. Basically, it'll let you use our servers (running WebSync + IIS) to handle the long lived connections, but allow you to publish your messages via PHP, and pre-process your messages in PHP. If you're going to have < 10 simultaneous users, it's free, so for a small site it should do exactly what you need.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.