| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On Jun 21, 2005, at 2:02 AM, Heath Raftery wrote:
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: http://lists.apple.com/mailman/options/macnetworkprog/email@hidden This email sent to email@hidden
| References: | |
| >UDP packets greater than 510 bytes clipped (From: Heath Raftery <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.