#65·cim

为什么服务器在将消息转发给目标客户端时要使用 netty 而不是直接调用 http?

作者: nju-Nicko创建于 2019年10月31日更新于 2025年12月25日
标签question

For example, in the case of clientA sending a message to clientB, here is how I currently organize the process: clientA -> (http invoke) -> router -> (http invoke) -> server, and when the server forwards the message to clientB, it looks up the SessionSocketHolder, finds the corresponding NioSocketChannel, and then writes the message into it. So my question is, why does the request sent from the client to the server go directly through http, which is handled by the SpringBoot Controller, while the request forwarded by the server goes through netty?

内容来源: crossoverJie/cim