• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Benefits of CFSocketSendData() over send()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Benefits of CFSocketSendData() over send()
      • From: Quinn <email@hidden>
  • Prev by Date: Re: CFDataGetBytes causes crash in socket callback
  • Next by Date: CFNetwork SSL and long blocking delays
  • Previous by thread: Re: CFDataGetBytes causes crash in socket callback
  • Next by thread: Re: Benefits of CFSocketSendData() over send()
  • Index(es):
    • Date
    • Thread