Quantcast
Channel: Embedded Software (Read Only)
Viewing all articles
Browse latest Browse all 25965

Forum Post: RE: How to catch the moment when NDK has received data from TCP or UDP socket?

$
0
0

Hi Vitalii,

recv and recvfrom are part of the TCP/IP stack standard.  Callbacks cannot be hooked into the stack to handle cases where information is received.

[quote user="Vitalii Kukush"]

 or I must periodically call recv with  flags = MSG_DONTWAIT. Could You suggest any alternative method?

[/quote]

It is a common practice to not block waiting for data.  This approach will require that your application be able to handle situations where the data is not received all at once (maintain a data buffer and count of bytes received, etc).

Thanks,

-- Emmanuel


Viewing all articles
Browse latest Browse all 25965

Trending Articles