• 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
Re: UDP packets greater than 510 bytes clipped
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UDP packets greater than 510 bytes clipped


  • Subject: Re: UDP packets greater than 510 bytes clipped
  • From: Douglas Davidson <email@hidden>
  • Date: Tue, 21 Jun 2005 11:11:18 -0700


On Jun 21, 2005, at 2:02 AM, Heath Raftery wrote:

I'm using the socket, bind and sendto calls to establish and send UDP data, and NSFileHandle's readInBackgroundAndNotify to read. Would I be right in discovering readToEndOfFileInBackgroundAndNotify does not apply to UDP?



NSFileHandle is not really designed for datagram-oriented protocols.  I would suggest using CFSocket instead, if you wish to receive notifications of data on your run loop.  

Something like

    CFSocketRef s = CFSocketCreateWithNative(NULL, sock, kCFSocketDataCallBack, dataArrived, NULL);
    CFRunLoopSourceRef source = CFSocketCreateRunLoopSource(NULL, s, 0);
    CFRunLoopAddSource(CFRunLoopGetCurrent(), source, kCFRunLoopDefaultMode);

where sock is your UDP socket and

void dataArrived(CFSocketRef s, CFSocketCallBackType type, CFDataRef address, const void *data, void *info) {
    // this is your callback, data is a CFDataRef containing your data
}

Douglas Davidson

 _______________________________________________
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

References: 
 >UDP packets greater than 510 bytes clipped (From: Heath Raftery <email@hidden>)

  • Prev by Date: Re: UDP packets greater than 510 bytes clipped
  • Next by Date: Re: UDP packets greater than 510 bytes clipped
  • Previous by thread: Re: UDP packets greater than 510 bytes clipped
  • Next by thread: attached gateways
  • Index(es):
    • Date
    • Thread