masi al
masi al

Reputation: 1

netty send same message to different channel ,something happen。。。

Of course! Here is the English translation of your problem description and the architecture:

Problem Description and Architecture Architecture Diagram:

Central Server: After calculating the player ranking information, the central server sends the data in batches to the message forwarding server. Message Forwarding Server: The message forwarding server receives the data from the central server and dispatches it to Game Server 1 and Game Server 2. Game Servers: Game Server 1 and Game Server 2 actively send heartbeat detection messages to the message forwarding server. The message forwarding server sends heartbeat response messages back to the game servers. Detailed Problem Description:

Scenario: The central server completes the calculation of player rankings and sends the data to the message forwarding server in batches. The message forwarding server then dispatches the data to Game Server 1 and Game Server 2. When only Game Server 1 is present, there is no issue. However, when Game Server 2 is added, both game servers experience problems. Issue: Both Game Server 1 and Game Server 2 can actively send heartbeat detection messages. The message forwarding server receives the heartbeat detection messages and sends back the heartbeat responses. Despite this, the game servers do not receive the heartbeat responses or experience timeouts, leading to the game servers actively disconnecting from the message forwarding server.enter image description here

i test retain() and copy() why copy() is ok? and i ask gpt it tell me. Sending Order Issue: Asynchronous Nature of writeAndFlush(): Netty's writeAndFlush() method operates asynchronously. Data is first written to the Channel's outbound buffer, and then the data is sent out by Netty's EventLoop asynchronously. Scheduling of Multiple Channels: When multiple Channels share the same ByteBuf instance for sending, the scheduling order and sending order cannot be guaranteed to be consistent. Uncertain Actual Sending Order: Due to the asynchronous nature of network transmission and scheduling uncertainty, the actual sending order might differ from the expected order, leading to discrepancies in the message arrival sequence. Network Delay Issue: Impact of Network Load: In a high concurrency environment, high network load can lead to increased network latency. Packet Queuing and Congestion: Due to packet queuing and congestion in the network, some messages may be delayed in sending or receiving, affecting the timeliness of the messages.

Upvotes: 0

Views: 30

Answers (0)

Related Questions