File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -252,8 +252,8 @@ static if (eventLoopMechanism == EventLoopMechanism.epoll)
252252 assert (conn ! is null , " epoll event with null socket" );
253253
254254 runUserEventHandler({
255- // Handle errors first
256- if (ev.events & ( EPOLLERR | EPOLLHUP ) )
255+ // Handle errors
256+ if (ev.events & EPOLLERR )
257257 {
258258 debug (ASOCKETS ) stderr.writefln(" \t %s - error" , conn);
259259 string errMsg = " socket error" ;
@@ -273,8 +273,8 @@ static if (eventLoopMechanism == EventLoopMechanism.epoll)
273273 debug (ASOCKETS ) stderr.writefln(" \t %s - calling onWritable" , conn);
274274 conn.onWritable();
275275 }
276- // Then read
277- else if (ev.events & EPOLLIN )
276+ // Then read (EPOLLHUP also triggers read so recv() returns 0 for EOF)
277+ else if (ev.events & ( EPOLLIN | EPOLLHUP ) )
278278 {
279279 debug (ASOCKETS ) stderr.writefln(" \t %s - calling onReadable" , conn);
280280 conn.onReadable();
You can’t perform that action at this time.
0 commit comments