I'm trying to create a real-time multiplayer web game and right now I'm using a database to hold the client actions and each client sends an AJAX to the database to continuously check for the other players action every 100 or 200 milliseconds, and I was wondering if there was a better way to go about this.
Is there a way for the server to actually contact the client if something in the database changes? Then if one client made an action the server could contact the other client to tell it that an action was made. Or is there another way to go about this better than a constant loop that checks the database for each client?