fuimaz / spserver

Automatically exported from code.google.com/p/spserver
Other
0 stars 0 forks source link

问题????? #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. 初始化AF_UNIX流fds[0], fds[1];
2. 
使用libevent接口,为fds[0],注册EV_READ和EV_WRITE事件callback函数e
vread,
evwrite,其中evread将数据从fd中读取出来,evwrite不做任何与fd��
�关的事情。
3. 向fds[1]中write字符串"54321".
4. 连续调用libevent接口event_base_loop( mEventBase, EVLOOP_ONCE )三次。

问题:
为什么 write 事件的callback函数evwrite被调用了三次。

Original issue reported on code.google.com by jason.m...@hotmail.com on 24 Mar 2009 at 9:29

Attachments:

GoogleCodeExporter commented 9 years ago
类似这类不确定是否为 bug 的问题,还是用 google groups 
或者私下邮件沟通吧。
把这类问题放到了 issue 里面,很难处理。

fds[0] 的 EV_WRITE 事件,在上述的情况下,总是有效的。
调用了 event_base_loop 就会触发对应 callback 的执行。
如果不想触发 callback ,那么就不要先注册 EV_WRITE ,
等到真正有东西要写的时候再来注册。

Original comment by stephen....@gmail.com on 24 Mar 2009 at 9:37

GoogleCodeExporter commented 9 years ago
谢谢

Original comment by jason.m...@hotmail.com on 25 Mar 2009 at 1:13