V
V
vizaville2015-06-23 18:39:06
Game development
vizaville, 2015-06-23 18:39:06

Which protocol for the game to choose (client-server)?

We recently developed a client-server game on the cocos2d-x engine. The server was written in Node.js, Websocket was used as the data transfer protocol. Now we are faced with such a problem, with a bad connection (3g), the connection is broken, and since the websocket is based on tcp. Do you think it's better to switch to udp or still stay websocket and solve this problem with automatic reconnect?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Lozovyuk, 2015-06-23
@aleks_raiden

Far from sure if udp will be passed by the network architecture (on the way from the client to you). It is better to ensure the maximum compression of the protocol (it will improve performance, since the data size will be smaller), well, and implement reconnections yourself. If it works out - try SPDY, for example.

X
xmoonlight, 2015-06-24
@xmoonlight

1. Exactly reconnect.
2. Whether or not to block the game at this moment depends on the type of game.
If the game is turn-based or someone is faster, then you can not lock it .. After the connection appears, synchronize the timers and that's it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question