Turn the game: use SignalR or both SignalR and REST API?

I am writing a mobile game from turn to turn. Each game has 2 minutes. Therefore, every two minutes the server will calculate the rating and generate the next game for customers. I am using Asp.net to record a server.
I choose SignalR for communication between client and server. I have 2 options for implementing games:
1) Use SignalR only for communication with customers
2) Use SignalR to notify the client and use the REST API to receive or update information about the game.

Could you advise me which choice is better, and please explain the details.

Thanks in advance.

+3
rest signalr multiplayer
Jul 25 '12 at 9:40
source share
1 answer

As long as I'm not a SignalR expert, I can tell you this:

Since you chose SignalR, use it for all the tasks that it can perform.

Sending updated game information to the client definitely seems like a challenge for SignalR. The lack of a separate REST api is not required.

Sending a message through SignalR that the status is updated, and the client must make a REST call to receive the updated information, is an unnecessary additional request. I would avoid this and use SignalR to send updated information.

+3
Jul 25 '12 at 10:35
source share



All Articles