I'm building a website where you can play games. When the player makes a move, I want to send that move to the server, then use C# to compute a response and return that back to the client. I'm fine with doing all the client-side stuff in JavaScript, I'm just trying to figure out how I should do the communication.
I was thinking about using socket.io, but I believe that requires me to write both the server and client in JS. So, I'm not sure what approach to take. Do I
- try to get socket.io to communicate with a C# DLL, or do I
- write the whole web-server in C# (should be relatively simple, no?). If so, can I still use socket.io client-side? It's just sending basic requests to the server, which I should be able to catch, no?
- Or should I drop socket.io altogether, and just use jquery+ajax to send http requests to my server....but then how do I respond? Also, HTTP isn't as efficient/lightweight as sockets, is it?
I want to keep the communication as light as possible so that I can get fast response times and lighter server load.