diff options
Diffstat (limited to 'toxcore/Messenger.c')
-rw-r--r-- | toxcore/Messenger.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index 09095e5f..e4387fcb 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c | |||
@@ -1390,18 +1390,16 @@ void doMessenger(Messenger *m) | |||
1390 | } | 1390 | } |
1391 | 1391 | ||
1392 | /* | 1392 | /* |
1393 | * Waits for something to happen on the socket for up to milliseconds milliseconds | 1393 | * functions to avoid excessive polling |
1394 | * *** Function MUSTN'T poll. *** | ||
1395 | * The function mustn't modify anything at all, so it can be called completely | ||
1396 | * asynchronously without any worry. | ||
1397 | * | ||
1398 | * returns 0 if the timeout was reached | ||
1399 | * returns 1 if there is socket activity (i.e. tox_do() should be called) | ||
1400 | * | ||
1401 | */ | 1394 | */ |
1402 | int waitMessenger(Messenger *m, uint16_t milliseconds) | 1395 | int waitprepareMessenger(Messenger *m, uint8_t *data, uint16_t *lenptr) |
1396 | { | ||
1397 | return networking_wait_prepare(m->net, sendqueue_total(m->net_crypto->lossless_udp), data, lenptr); | ||
1398 | } | ||
1399 | |||
1400 | int waitexecuteMessenger(Messenger *m, uint8_t *data, uint16_t len, uint16_t milliseconds) | ||
1403 | { | 1401 | { |
1404 | return networking_wait(m->net, sendqueue_total(m->net_crypto->lossless_udp), milliseconds); | 1402 | return networking_wait_execute(data, len, milliseconds); |
1405 | }; | 1403 | }; |
1406 | 1404 | ||
1407 | /* return size of the messenger data (for saving) */ | 1405 | /* return size of the messenger data (for saving) */ |