blue-flower-12209
09/18/2026, 4:26 PMcool-fountain-95457
09/18/2026, 4:27 PMhow argument to SHUT_RD or SHUT_RDWR but not SHUT_WR for it to cancel the accept.
$ zig run accept_client.zig
info: accepting clients on 7788
warning: shutting down the accepting socket 4 with how value .SHUT_WRITE
info: shutdown: .{ .user_data = 2, .res = 0, .flags = 0 }, cqe.res: 0
This is not something i expected, shouldn't the res field contain an errno here 🤔cool-fountain-95457
09/18/2026, 4:27 PMcool-fountain-95457
09/19/2026, 3:33 PMio_uring_prep_shutdown to see how it interacts with various other io operations.
i set up this tcp server which accepts a client, sends it 1mb, then closes the socket. the client on the other hand, connects, waits for enough milliseconds to allow the socket to fill up with the 1mb of data, then shuts down the socket's read side, and starts issuing `io_uring_prep_recv`s. And during the reaping of CQEs I get these:
info: recv: .{ .user_data = recv, .res = 128000, .flags = 4 }
info: recv: .{ .user_data = recv, .res = 95232, .flags = 4 }
info: recv: .{ .user_data = recv, .res = 411136, .flags = 4 }
info: recv: .{ .user_data = recv, .res = 285696, .flags = 4 }
info: recv: .{ .user_data = recv, .res = 128512, .flags = 4 } // received EXACTLY one MB up to here.
info: recv: .{ .user_data = recv, .res = 0, .flags = 4 }
the flags = 4 is for IORING_CQE_F_SOCK_NONEMPTY which i found strange in the last CQE with res = 0 since there is no more data to read but it made me suspect that the server closing the socket is probably what's causing it, and it turns out my intuition is correct, here's what it looks like when the server doesn't close the client socket:
info: recv: .{ .user_data = 2, .res = 128000, .flags = 4 }
info: recv: .{ .user_data = 2, .res = 95232, .flags = 4 }
info: recv: .{ .user_data = 2, .res = 411136, .flags = 4 }
info: recv: .{ .user_data = 2, .res = 285696, .flags = 4 }
info: recv: .{ .user_data = 2, .res = 128512, .flags = 0 }
info: recv: .{ .user_data = 2, .res = 0, .flags = 0 }
can someone confirm whether IORING_CQE_F_SOCK_NONEMPTY has some sort of dependence on TCP segments like FIN?cool-fountain-95457
09/19/2026, 3:41 PMtest/accept-non-empty.c, just learned that SOCK_NONEMPTY is also used for accepts to signal that there are more pending connections, neat stufforange-cricket-67457
09/30/2026, 7:13 PMblue-flower-12209
09/30/2026, 8:28 PMblue-flower-12209
09/30/2026, 8:28 PMblue-flower-12209
09/30/2026, 8:29 PMbetter-helmet-21984
10/07/2026, 8:21 PMorange-cricket-67457
10/07/2026, 8:46 PMorange-cricket-67457
10/07/2026, 8:47 PMcool-fountain-95457
10/07/2026, 8:50 PMorange-cricket-67457
10/07/2026, 8:51 PMorange-cricket-67457
10/07/2026, 8:51 PMcool-fountain-95457
10/07/2026, 8:52 PMcool-fountain-95457
10/07/2026, 8:53 PMcool-fountain-95457
10/07/2026, 8:53 PMorange-cricket-67457
10/07/2026, 8:55 PMcool-fountain-95457
10/07/2026, 8:56 PMcool-fountain-95457
10/07/2026, 8:56 PMblue-flower-12209
10/07/2026, 8:57 PMblue-flower-12209
10/07/2026, 8:58 PMorange-cricket-67457
10/07/2026, 8:58 PMorange-cricket-67457
10/07/2026, 8:58 PMblue-flower-12209
10/07/2026, 9:06 PMblue-flower-12209
10/07/2026, 9:06 PMblue-flower-12209
10/07/2026, 9:07 PMenum OpType and assign each user_data an index into the slotmap, so then from there it's just a normal match kind of thingorange-cricket-67457
10/08/2026, 8:31 PMcool-fountain-95457
11/07/2026, 10:28 PM