Skip to content

Instantly share code, notes, and snippets.

@dennda
Created September 12, 2011 22:10
Show Gist options
  • Save dennda/1212608 to your computer and use it in GitHub Desktop.
Save dennda/1212608 to your computer and use it in GitHub Desktop.
CFSocket: No accept callback? Here's the problem:
// Doesn't work:
readsock = CFSocketCreate(kCFAllocatorDefault, PF_INET, SOCK_STREAM,
IPPROTO_TCP, kCFSocketReadCallBack |
kCFSocketAcceptCallBack | kCFSocketDataCallBack |
kCFSocketConnectCallBack | kCFSocketWriteCallBack,
(CFSocketCallBack)&readSockCallBack, info);
// Works:
readsock = CFSocketCreate(kCFAllocatorDefault, PF_INET, SOCK_STREAM,
IPPROTO_TCP, kCFSocketAcceptCallBack,
(CFSocketCallBack)&readSockCallBack, info);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment