1

I want to build a question/answer game with rooms and chat. Is it possible to make it with just PHP and HTTP requests? From you're experience, how many visitors will it hold. I know it's better with socket server but I only have a shared host right now.

1 Answer 1

2

Sure it's possible with only PHP+HTTP. You'd have to have a poller running on a setInterval to keep asking the server via XMLHttpRequest if there are new lines of chat or game moves, though. How many users you can support depends on how quick that update time must be; if users can wait many seconds between polls you won't have a problem, but if they need split-second updates that's a lot of polling and your shared server won't be sufficient at all.

For any realtime responsive chat or action games you would need your own ‘socket server’ type of arrangement, using ‘Comet’-style long-polling techniques, Flash sockets or, in the future, HTML5's much more convenient WebSocket.

(I'd look at virtual dedicated servers anyway; they're cheap these days and sharing a server for PHP scripts puts you at the mercy of other users for performance and security.)

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

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.