| ... | ... | @@ -904,10 +904,18 @@ pub const IncomingMessage = struct { |
| 904 | 904 | data: []u8, |
| 905 | 905 | /// Supplied by caller before calling receive functions; mutated by receive |
| 906 | 906 | /// functions. |
| 907 | | control: []u8 = &.{}, |
| 907 | control: []u8, |
| 908 | 908 | /// Populated by receive functions. |
| 909 | 909 | flags: Flags, |
| 910 | 910 | |
| 911 | /// Useful for initializing before calling `receiveManyTimeout`. |
| 912 | pub const init: IncomingMessage = .{ |
| 913 | .from = undefined, |
| 914 | .data = undefined, |
| 915 | .control = &.{}, |
| 916 | .flags = undefined, |
| 917 | }; |
| 918 | |
| 911 | 919 | pub const Flags = packed struct(u8) { |
| 912 | 920 | /// indicates end-of-record; the data returned completed a record |
| 913 | 921 | /// (generally used with sockets of type SOCK_SEQPACKET). |
| ... | ... | @@ -1146,6 +1154,8 @@ pub const Socket = struct { |
| 1146 | 1154 | pub fn receiveManyTimeout( |
| 1147 | 1155 | s: *const Socket, |
| 1148 | 1156 | io: Io, |
| 1157 | /// Function assumes each element has initialized `control` field. |
| 1158 | /// Initializing with `IncomingMessage.init` may be helpful. |
| 1149 | 1159 | message_buffer: []IncomingMessage, |
| 1150 | 1160 | data_buffer: []u8, |
| 1151 | 1161 | flags: ReceiveFlags, |