cool-fountain-95457
09/18/2026, 2:36 PMcool-fountain-95457
09/18/2026, 2:38 PMblue-flower-12209
09/18/2026, 2:39 PMblue-flower-12209
09/18/2026, 2:40 PMblue-flower-12209
09/18/2026, 2:40 PMblue-flower-12209
09/18/2026, 2:40 PMblue-flower-12209
09/18/2026, 2:41 PMcool-fountain-95457
09/18/2026, 2:42 PMblue-flower-12209
09/18/2026, 2:42 PMcool-fountain-95457
09/18/2026, 2:43 PMcool-fountain-95457
09/18/2026, 2:46 PMcool-fountain-95457
09/18/2026, 2:46 PMblue-flower-12209
09/18/2026, 2:47 PMcool-fountain-95457
09/18/2026, 2:47 PMblue-flower-12209
09/18/2026, 2:48 PMblue-flower-12209
09/18/2026, 2:49 PMblue-flower-12209
09/18/2026, 2:49 PMcool-fountain-95457
09/18/2026, 2:52 PMblue-flower-12209
09/18/2026, 2:53 PMblue-flower-12209
09/18/2026, 2:53 PMcool-fountain-95457
09/18/2026, 3:48 PMclose on socket that has a pending recv, I got this from using golang where it's normal to call conn.Close() from another goroutine to stop the reading/writing.... It just hangs like the accept you mentioned.cool-fountain-95457
09/18/2026, 3:52 PMcool-fountain-95457
09/18/2026, 4:01 PMhundreds-school-61590
09/18/2026, 4:22 PMblue-flower-12209
09/18/2026, 4:26 PMblue-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 stuff