Netty OIO或NIO(Netty OIO or NIO)
我有多级网络基础设施。 第1层有8台服务器每秒从10000个客户端接收数据。 我想用大约2或3个实例编写代理层来将数据从第1层传输到后端层。
我发现Netty很方便我写这样的程序。 但我还是在NIO或OIO之间混淆,因为我只有8台服务器,同时在Netty的文件中说服务器的OIO连接低于1000,比应该使用NIO多。
我担心使用OIO会阻塞流并使某些消息延迟。 我需要在收到请求后立即回复客户。
愿任何人建议我解决方案,我是网络和Netty的新手。
I have multi stages network infrastructure. Layer 1 has 8 servers receive data from 10000 clients every second. I'd like to write proxy layer with about 2 or 3 instances to transfer data from layer 1 to backend layer.
I found Netty quite convenient for me to write such a program like this. But I still confuse between NIO or OIO, because I only have 8 servers, meanwhile in document of Netty says that OIO for server has lower than 1000 connection, more than that should use NIO.
I'm afraid that using OIO will block the stream and make some messages delay. I need to response to the clients instantaneously after receive the request.
May anyone suggest me the solution, I'm new to network and Netty.
原文:https://stackoverflow.com/questions/20637717
满意答案
这应该工作。
<LinearLayout android:weightSum="2" android:layout_width="100dp" android:layout_height="wrap_content" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android" > <ImageView android:layout_weight="1" android:id="@+id/horizontal_list_image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" /> <TextView android:layout_weight="1" android:id="@+id/horizontal_list_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:text="FFFFFFFF" android:textSize="15sp"/> </LinearLayout>
This should work.
<LinearLayout android:weightSum="2" android:layout_width="100dp" android:layout_height="wrap_content" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android" > <ImageView android:layout_weight="1" android:id="@+id/horizontal_list_image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" /> <TextView android:layout_weight="1" android:id="@+id/horizontal_list_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:text="FFFFFFFF" android:textSize="15sp"/> </LinearLayout>
相关问答
更多RecycleView不显示数据(RecycleView do not displaying the data)
列表视图到Recycleview(Listview to Recycleview)
使用RecycleView时设置列的宽度(set width of columns when using RecycleView)
如何在一个Activity中显示两个RecycleView?(How can I display two RecycleViews in one Activity?)
Android Studio:RecycleView中的项目“跳转”到左侧(Android Studio: Items in RecycleView “jumps” to the left)
Horizontal RecycleView不显示其完整内容(Horizontal RecycleView doesn't display its full content)
如何获得RecycleView的滚动坐标?(How is it possible get scroll coordinates of a RecycleView?)
从Kivy Recycleview获取选定节点(Get selected node from Kivy Recycleview)
RecycleView不会更新(RecycleView Wont update)
RecycleView内的TextView Marquee(TextView Marquee inside RecycleView)
相关文章
更多[Netty 1] 初识Netty
Netty源码分析
Java NIO系列教程(一) Java NIO 概述
Netty入门实例-时间服务器
Netty环境配置
Netty开发环境配置
Java:IO/NIO篇,读写属性文件(properties)
solr启动时报错java.nio.channels.OverlappingFileLockException
storm学习之Netty代替ZMQ
Netty基于流的传输处理
最新问答
更多获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
如何通过引用返回对象?(How is returning an object by reference possible?)
矩阵如何存储在内存中?(How are matrices stored in memory?)
每个请求的Java新会话?(Java New Session For Each Request?)
css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
xcode语法颜色编码解释?(xcode syntax color coding explained?)
在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!