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决定,内核默认 ...
随机推荐
- 廖雪峰Java2面向对象编程-5包和classpath-1包package
1.package的意义 如下,存在多个相同类名的文件.当引用Person类,将无法确定引用小红,还是小明的Person类,即同名类的冲突. 小明的Person类:Person 小红的Person类: ...
- div+css命名大全
头:header 内容:content/container 尾:footer 导航:nav 侧栏:sidebar 栏目:column 页面外围控制整体布局宽度:wrapper 左右中:lef ...
- folly无锁队列,尝试添加新的函数(续)
基于上一篇文章,dropHead取出节点后,删除节点,会出现内存访问的问题.按照这个逻辑,如果将移出的节点保存到一个无锁队列中,然后在需要节点的时候,从这个备用的无锁队列中取出节点,那么应该就可以避开 ...
- 用gradle打包可运行jar
参考了 http://www.cnblogs.com/yongtao/p/4104526.html gradle文件加入 apply plugin: 'application' mainClassNa ...
- []map[][]切片map小计
go中的map我们都知道在进行遍历的时候我们知道他是无序的.对于map[int]interface{}类型的,我们可以通过计算map的长度,通过定长的for循环,进行顺序的输出. 那么如果map的类型 ...
- 搭建好lamp,部署owncloud。
先上传两个文件 上传到root目录 上传到opt目录下 #mkdir /opt/dvd1 #mount /dev/sr0 /opt/dvd1 #cd /etc/yum.repos.d/ #vi dvd ...
- [UE4]增加机器人
一.新增蓝图继承自Shooter名为AIShooter.玩家角色也是继承自Shooter. 二.使用AIMoveTo追踪玩家.玩家控制的角色调用这个方法没反应. 三.关卡中添加组件NavMeshBou ...
- typescript可索引接口 类类型接口
/* 接口的作用:在面向对象的编程中,接口是一种规范的定义,它定义了行为和动作的规范,在程序设计里面,接口起到一种限制和规范的作用.接口定义了某一批类所需要遵守的规范,接口不关心这些类的内部状态数据, ...
- 第七章 :分布式监控与SNMP监控
7.1 分布式监控 7.1.1 作用 分担压力,减轻负载 多机房监控 zabbix Server ===> zabbix agent (只能同一个局域网监控) 分担压力,降低负载 zabbi ...
- Mysql-Client编码问题
Mysql编码问题! 首先,安装完mysql之后,登录进去(从控制台), 先要查看mysql编码:SHOW VARIABLES LIKE 'char%': (我这里是修改好的) 如果是没修改的,因为当 ...