Websocket messages -

ساخت وبلاگ

Vote count: -1

For a real-time multiplayer game, the server is sending binary messages to the client with Websocket.

The first byte (uint8) of a message would be the "packet ID".

Example: packet 1 to "update entity": x, y, score, name in the next bytes.

But, to optimize the bandwidth, I would like to send only values that change between 2 frames.

Example (all values changed): packet 2 to "update entity position": x, y

packet 3 to "update entity score": score

packet 4 to "update entity name": name

My question is: is sending a lot of messages (packet 2, 3, 4) the same than sending 1 message (1 packet) not divided, in term of size (without considering the additional "packet ID" byte, negligible) ? Isn't there an additional cost to each Websocket message ?

asked 2 mins ago

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : websocket messages,websocket messages per second,websocket lost messages,parsing websocket messages,websocket binary messages,websocket control messages,websocket error messages,spring websocket message sending operations,websocket past messages,websocket view messages, نویسنده : استخدام کار backsoft بازدید : 349 تاريخ : يکشنبه 7 شهريور 1395 ساعت: 3:11