pub fn receiveTimeout( s: *const Socket, io: Io, buffer: []u8, timeout: Io.Timeout, ) ReceiveTimeoutError!IncomingMessage
Waits for data. Connectionless.
Returns error.Timeout if no message arrives early enough.
error.Timeout
See also:
receive
receiveManyTimeout
s: *const Socket
io: Io
buffer: []u8
timeout: Io.Timeout
1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204
pub fn receiveTimeout( s: *const Socket, io: Io, buffer: []u8, timeout: Io.Timeout, ) ReceiveTimeoutError!IncomingMessage { var message: IncomingMessage = .init; const maybe_err, const count = (try io.operateTimeout(.{ .net_receive = .{ .socket_handle = s.handle, .message_buffer = (&message)[0..1], .data_buffer = buffer, .flags = .{}, } }, timeout)).net_receive; if (maybe_err) |err| return err; assert(1 == count); return message; }
Waits for data. Connectionless.
Returns
error.Timeoutif no message arrives early enough.See also:
receivereceiveManyTimeout