3

I am porting a linux server to ios. It is a single threaded, event driven design that uses kqueue on OSX to handle sockets and other events. Is there something similar on ios?

Thanks!

Jacko
  • 12,665
  • 18
  • 75
  • 126

1 Answers1

0

You could try using CoreFoundation. CFRunLoop can run an event loop for you, with sources including file descriptors and sockets.

Lily Ballard
  • 182,031
  • 33
  • 381
  • 347
  • Thanks, Kevin. The original code uses kqueue, so I don't want to change this unless I have to. – Jacko Feb 20 '11 at 16:19
  • 1
    Well, you're in luck. I assumed from the existence of the question that kqueue doesn't exist on iOS, but after looking at the headers, it does indeed seem to be there. – Lily Ballard Feb 20 '11 at 22:59
  • 1
    Old question, kqueue is available in iOS. Check Apple's example code: DirectoryWatcher. – ZYiOS Nov 20 '12 at 12:49