Websockets, or webservers?
If I wanted to make a game in python that’s text bassed, and I wanted to be able to play with someone else, would it be better to use a web server or websocket to communicate data?
Voters
If I wanted to make a game in python that’s text bassed, and I wanted to be able to play with someone else, would it be better to use a web server or websocket to communicate data?
Websockets are quite worth it. That said, it really depends. If your game periodically sends data, you could always go for long polling (AJAX requests periodically).
Web sockets allow connections between the server and the client without having to send additional headers each time a message is sent.
Websockets are most of the time used for games, so yes I would definitely recommend websockets.
I know I am making a little program (website) that has to send messages across worker threads and the latency is up to 1 second! However, that isn't with the websockets, rather, it is with the main thread getting so occupied that it can't maintain a steady and quick cycle (using
requestAnimationFrame
). From what I can guess, it would probably either be the network or the program itself that is causing the latency.