Netty中的连接池 [英] Connection pooling in Netty
本文介绍了Netty中的连接池的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用Netty构建反向代理,我想保留一个到后端服务器的开放套接字池,而不是每个传入的套接字都需要从反向代理到后端服务器的新套接字.
I'm trying to build a reverse proxy with Netty, and I'd like to keep a pool of open sockets to the backend servers, instead of every incoming socket requiring a new socket from the reverse proxy to a backend server.
您可以使用Netty进行此操作吗?怎么样?
Can you do this with Netty? How?
感谢您的帮助
推荐答案
好吧,回答我自己的问题,在 endpointsToChannelFutures的用法.
Ok, answering my own question, there is a nice example how to do this in the LittleProxy source code. In particular, in HttpRequestHandler.java, follow the usage of endpointsToChannelFutures.
这篇关于Netty中的连接池的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文