Benefits of CFSocketSendData() over send()
Benefits of CFSocketSendData() over send()
- Subject: Benefits of CFSocketSendData() over send()
- From: Liwei <email@hidden>
- Date: Tue, 7 Oct 2008 03:42:12 +0800
I'm not sure whether to use CFSocketSendData() or send() to send data
over a UDP socket.
I need to be able to send a large chunk of data and have the function
tell me precisely how much has been sent so that I can retry with the
remaining data. I know that send() can do that, even a sendall() is
available that automatically retries sending all unsent data (although
if it fails, it won't tell me how much had been sent).
However, I can't seem to find any documentation on precisely how
CFSocketSendData() works. I need to know the following:
1. How much data can I send each time?
2. Can I just throw in a big chunk without knowing the MTU of the network?
3. What happens when the network is busy and cannot send all the data?
4. Does a timeout of 0 mean the send occurs in the background?
5. Would I be able to tell how much data has been sent?
I feel tempted to use send() but the idea of using a CoreFoundation
replacement sounds OS-friendly.
Also, is there a nice function to tell if a socket is available for
sending other than using select() and callbacks?
Thanks!
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden