出现epoll failed: Bad file descriptor的原因
今天遇到了这个问题,之前找了半天原来是IO事件的socket描述符在epoll_ctl()处理之前关闭了。
if(epoll_ctl(epollFd, EPOLL_CTL_DEL, ev->fd, &epv) < 0)
fprintf(stderr, "Event Del failed[fd=%d], epoll failed: %s\n",ev->fd, strerror(errno));
在删除事件 epoll_ctl(kdpfd, EPOLL_CTL_DEL, events[n].data.fd,&ev);
之前 调用close()关闭socket描述符,
就会导致删除事件时epoll_ctl()返回值小于0,并且提示epoll failed: Bad file descriptor
事件删除后,再调用close()关闭对应的socket描述符就不会报错了。
出现epoll failed: Bad file descriptor的原因的更多相关文章
- 近期编程问题——epoll failed:bad file descriptor
出现问题:epoll_wait:Bad file descriptor 原因:IO时间的socket描述符在epoll_ctl处理前就关闭了. 解决方法:不要在epoll_ctl之前关闭socket描 ...
- fastDFS errcode:9 path:Bad file descriptor errcode:22 path:Invalid argument
fastDFS errcode:9 path:Bad file descriptor errcode:22 path:Invalid argument <error>status:4 er ...
- java.net.SocketException: recvfrom failed: EBADF (Bad file descriptor)
1. 问题说明: 与服务器之间进行socket通信的时候,客户端关闭socket之后,会抛出一个IOException,异常信息如下: java.net.SocketException: recvfr ...
- Ceph osd启动报错osd init failed (36) File name too long
在Ceph的osd节点上,启动osd进程失败,查看其日志/var/log/ceph/ceph-osd.{osd-index}.log日志,报错如下: 2017-02-14 16:26:13.55853 ...
- dpdk EAL: Error reading from file descriptor 23: Input/output error
执行test程序时输出: EAL: Error reading from file descriptor 23: Input/output error 原因: 在虚拟机添加的网卡,dpdk不支持导致的 ...
- Vue.js报错Failed to resolve filter问题原因
Vue.js报错Failed to resolve filter问题原因 金刚 vue Vue.js js javascript 之前使用vue.js写分页功能时,写了一个过滤器,发现一个比较奇怪的错 ...
- ORA-19563: header validation failed for file
在测试服务器还原数据库时遇到了ORA-19563错误.如下所示 RMAN-00571: ======================================================== ...
- 出现Bad command or the file name的原因
出现Bad command or file name的原因 中文释义:错误的命令或文件名 . 错误原因:不能识别输入的命令 . 方法:检查所输入的指令是否正确,包括拼写和大小写等情况.
- mongodb在ubuntu下的couldn‘t remove fs lock errno:9 Bad file descriptor的错误
按照官网上的安装方法: 在ubuntu系统下有可能出现如下错误: couldn't remove fs lock errno:9 Bad file descriptor 此时需要修改文件所有者 $ s ...
随机推荐
- canvas绘制简单图形
canvas绘图篇: canvas绘制矩形: <!DOCTYPE html> <html> <head lang="en"> <meta ...
- [置顶]
都是类型惹的祸——小心unsigned
正如我们所知道的,编程语句都有很多的基本数据类型,如char,inf,float等等,而在C和C++中还有一个特殊的类型就是无符号数,它由unsigned修饰,如unsigned int等.大家有没想 ...
- C# DataTable的常用用法讲解
在项目中经常用到DataTable,如果DataTable使用得当,不仅能使程序简洁实用,而且能够提高性能,达到事半功倍的效果,现对DataTable的使用技巧进行一下总结. 一.DataTable简 ...
- Windows 常见进程
alg.exe描述: alg.exe是Windows系统的一个重要进程,它的功能是用来处理 Internet 连接共享及防火墙,最好不要结束这个进程.taskmgr.exe描述: Windowsxp ...
- scrapy-redis源码抛析
#scrapy-redis--->queue.py-->class FifoQueue 队列 LifoQueue(lastinfirstout栈) #self.server父类Base中链 ...
- linux命令-mount挂载umount卸载
格式化完成之后想写数据 要先挂载 //////////////////////////////////////////////////////////////////// [root@wangshao ...
- linux 信号量之SIGNAL 0<转>
我们可以使用kill -l查看所有的信号量解释,但是没有看到SIGNAL 0的解释. [root@testdb~]# kill -l 1) SIGHUP 2) SIGINT 3) SIGQUIT 4) ...
- PCL—点云分割(超体聚类) 低层次点云处理
博客转载自:http://www.cnblogs.com/ironstark/p/5013968.html 1.超体聚类——一种来自图像的分割方法 超体(supervoxel)是一种集合,集合的元素是 ...
- R: 绘图 pie & hist
问题: 绘制 pie .hist 图 解决方案: 饼图函数 pie( ) pie(x, labels = names(x), edges = 200, radius = 0.8, clockwise ...
- js定时任务
<input type="button" id="btn" value="保存图片" onclick="settime(th ...