Hello all,
I am developing a chat module for drupal. I plan to provide multiple backends for chat message processing. I initially started with AJAX and have now included long polling technique in it. Then I came across ape(ajax push engine) and it looks promising. But it will require server side installation of ape for the chat module to work. Although I will also include this as one of the backends for the chat, my main focus is to find a solution which can handle acceptable number of simultaneous chat connections WITHOUT making any server side modifications so that people can use it easily.
I was surfing on net and came across PHP Socket programming and it looks like a viable option.
- If I write a php based chat server, will I be able to maintain a connection which can send data in both directions(from server to client and vice versa) by only using jQuery(along with ActionScript)? Obviously I won't use AJAX on client side.
- Also how many connections will the server be able to handle simultaneously if I write an efficient php socket based chat script and say I dedicate 50MB of RAM to it?
- Will the people on shared hosting will be able to run the php based server side code because they don't have shell access, like we have an option to run cron?
- Also I have read somewhere php is not multi-threaded language so you shouldn't use socket at all. Is this true?
- Is there some other approach which I can use and will be more efficient than this without making any server side modification?