Skip to content

Commit f875162

Browse files
rluboscarlescufi
authored andcommitted
net: sockets: Report ZSOCK_POLLHUP when socket is in EOF state
Report ZSOCK_POLLHUP event if peer closed the connection, and thus the socket is in EOF state. Signed-off-by: Robert Lubos <[email protected]>
1 parent 7adee4d commit f875162

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

subsys/net/lib/sockets/sockets.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,6 +1364,10 @@ static int zsock_poll_update_ctx(struct net_context *ctx,
13641364
(*pev)++;
13651365
}
13661366

1367+
if (sock_is_eof(ctx)) {
1368+
pfd->revents |= ZSOCK_POLLHUP;
1369+
}
1370+
13671371
return 0;
13681372
}
13691373

0 commit comments

Comments
 (0)