Send and recv all data when necessary
Expose net_recv_all() and net_send_all(), equivalent of net_recv() and net_send(), but that waits/retries until the requested length has been transferred. Use these new functions where it was (wrongly) assumed that the requested length had been transferred.
This commit is contained in:
@@ -47,7 +47,7 @@ static SDL_bool process_event(struct controller *controller, const struct contro
|
||||
if (!length) {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
int w = net_send(controller->video_socket, serialized_event, length);
|
||||
int w = net_send_all(controller->video_socket, serialized_event, length);
|
||||
return w == length;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user