What are the appropiate use cases for sockets or requests?
Sockets maybe are good for everything which will happen frequently, like movement, chat.
(HTTP) Requests for things like level upgrade?
But I don’t have a good background on this. Maybe somebody can give a good explanation, when it makes sense to use them and why.
Thanks in advance.
A request is a message sent by a client of the service in a format and manner that the server understands. To send/communicate this message, the client needs network connection, which is what sockets are used for (e.g. to establish a TCP/IP connection on a particular port).
So you will have top open and use a socket for any communication over the network. The format and manner of that communication is dependend on the server (what it recognizes/understands). An HTTP request is a particular format of a communication (from the client to the server); often the response is given as an HTTP reply (from the server to the client).
As sending an HTTP request involves setting up a TCP/IP connection, sending the request and tearing down the connection, it is more economical to use a different communication protocol for longer-lasting communications (e.g. sending over a file or other largeer data).