mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-07-31 05:08:59 +00:00
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:
parent
d646f95a31
commit
a791c272bc
4 changed files with 23 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue