Netty socket.io 启用Epoll 模式异常
Epoll 环境为Linux 内核2.6 以上版本 Windows下不能启动
1:判断Linux环境
public static boolean isOSLinux() {
Properties prop = System.getProperties();
String os = prop.getProperty("os.name");
System.out.println(os);
if (os != null && os.toLowerCase().indexOf("linux") > -) {
return true;
} else {
return false;
}
}
if(isOSLinux()){
//使用Linux Epoll模型
log.info("启用Epoll");
config.setUseLinuxNativeEpoll(true);
}
2:pom.xml配置
参考地址: https://www.jianshu.com/p/bb3718226f36
<dependency>
<groupId>com.corundumstudio.socketio</groupId>
<artifactId>netty-socketio</artifactId>
<version>1.7.</version>
<exclusions>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-common</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-transpor</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-codec</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-resolver</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
</exclusion>
</exclusions>
</dependency> <!-- 客户端 -->
<dependency>
<groupId>io.socket</groupId>
<artifactId>socket.io-client</artifactId>
<version>1.0.</version>
</dependency> <dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1..Final</version>
</dependency>
3:启动成功后如图,有一个异常警告

处理方式
参考地址: https://github.com/robymus/netty-socketio/commit/fcc7d33df843eb2720529540ac1c37ffa0e262a4
4: SO_LINGER 什么意思呢,
参考地址: https://www.jianshu.com/p/0bff7c020af2
Netty socket.io 启用Epoll 模式异常的更多相关文章
- 【Spring Boot】集成Netty Socket.IO通讯框架
服务端 @Configuration public class NettySocketConfig { private static final Logger logger = LoggerFacto ...
- socket.io 入门教程
转载自:http://deadhorse.me/nodejs/2011/12/29/socket.io_induction.html socket.io socket.io是一个以实现跨浏览器.跨平台 ...
- Linux Network IO Model、Socket IO Model - select、poll、epoll
目录 . 引言 . IO机制简介 . 阻塞式IO模型(blocking IO model) . 非阻塞式IO模型(noblocking IO model) . IO复用式IO模型(IO multipl ...
- (转)Linux Network IO Model、Socket IO Model - select、poll、epoll
Linux Network IO Model.Socket IO Model - select.poll.epoll 原文:https://www.cnblogs.com/LittleHann/p/ ...
- socket.io简单入门(一.实现简单的图表推送)
引子:随着nodejs蓬勃发展,虽然主要业务系统因为架构健壮性不会选择nodejs座位应用服务器.但是大量的内部系统却可以使用nodejs试水,大量的前端开发人员转入全堆开发也是一个因素. 研究本例主 ...
- [转载] Linux下多路复用IO接口 epoll select poll 的区别
原地址:http://bbs.linuxpk.com/thread-43628-1-1.html 废话不多说,一下是本人学习nginx 的时候总结的一些资料,比较乱,但看完后细细揣摩一下应该就弄明白区 ...
- 3高并发server:多路IO之epoll
1 epoll epoll是Linux下多路复用IO接口select/poll的增强版本号,它能显著提高程序在大量并.发连接中仅仅有少量活跃的情况下的系统CPU利用率,由于它会复用文件描写叙述符 ...
- 《Linux/UNIX系统编程手册》第63章 IO多路复用、信号驱动IO以及epoll
关键词:fasync_helper.kill_async.sigsuspend.sigaction.fcntl.F_SETOWN_EX.F_SETSIG.select().poll().poll_wa ...
- Linux下多路复用IO接口epoll/select/poll的区别
select比epoll效率差的原因:select是轮询,epoll是触发式的,所以效率高. Select: 1.Socket数量限制:该模式可操作的Socket数由FD_SETSIZE决定,内核默认 ...
随机推荐
- eval方法将字符串转换成json对象
方法一: 使用Eval将json字符串转为json对象 var str = "name:'Jon',sex:'男'"; 将字符串进行处理: str = "{"+ ...
- windows编程之窗口抖动
仅仅让黑窗口抖动以供小白娱乐 #include<stdio.h> #include<windows.h> int main() { RECT rect;//RECT定义了一个矩 ...
- 服务网关zuul之四:zuul网关配置
禁用过滤器在Zuul中特别提供了一个参数来禁用指定的过滤器,该参数的配置格式如下:zuul.AccessFilter.pre.disable=true动态加载动态路由通过结合Spring Cloud ...
- AnimationDrawable写贞动画,播放完毕停止在第一或最后一帧
animation.stop();animation.selectDrawable(0);//只需要在停止的时候,设置下标为你想要的一帧就好了
- 浏览器兼容java小程序配置说明
最近在使用的一个web应用系统是内嵌了java小程序,遇到了各种浏览器兼容性问题,现梳理如下: 1.通过以下链接检测当前电脑是否已经安装有java https://java.com/zh_CN/dow ...
- xcode pod install 安装失败,提示缺少文件
I had the same problem in Xcode 6.1.1. I did the following to solve it: Set the configuration file s ...
- c语言数据类型(一)
(强数据类型) 1.常量 常量是程序中不可变的量 10为常量 两种常量 #define 定义宏常量 const #对于#define 类型的常量,c语言的习惯是常量名称大写, 对于普通const常量以 ...
- Redis的集群模式
集群 即使使用哨兵,此时的Redis集群的每个数据库依然存有集群中的所有数据,从而导致集群的总数据存储量受限于可用存储内存最小的数据库节点,形成木桶效应.由于Redis中的所有数据都是基于内存存储,这 ...
- J2EE与EJB
问题及答案来源自<Java程序员面试笔试宝典>第五章 Java Web 5.2 J2EE与EJB 1.什么是J2EE? J2EE是Java平台企业版的简称,是用来开发和部署企业级应用的一个 ...
- js语法规则 ---console.log ---- prompt ----基本类型 ---parseInt
在页面中可以在body里面加入type=”text/javascript” 例如: <script type="text/javascript"> </scrip ...