简体   繁体   English

封锁Netty 4

[英]Blocking in Netty 4

Is there any way for run some code in blocking mode in Netty 4 client? 有什么方法可以在Netty 4客户端中以阻止模式运行某些代码吗? I can't find any issue or example of how I can run some code in blocking mode. 我找不到任何有关如何在阻止模式下运行代码的问题或示例。 My problem is creating a user login system and I must get success or error from server rigth away after the request and dependency of response do another work in client side. 我的问题是创建用户登录系统,并且在请求和响应的依赖关系在客户端进行另一项工作之后,我必须从服务器的成功中获得成功或错误。 I don't believe that such a powerful tool can't do it 我不相信如此强大的工具无法做到

PS sorry for my English PS对不起我的英语

You don't need a blocking netty, what you need is to send data with netty client in the netty way, then waits on a SettableFuture object that will be set in the netty inbound handler. 您不需要阻塞的网络,您需要的是以网络方式与网络客户端发送数据,然后等待将在网络入站处理程序中设置的SettableFuture对象。 So it's your program that is blocking, not netty's. 因此,阻塞的是您的程序,而不是netty的程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM