The best way to do this now is to use Grand Central Dispatch. Your listening socket and the connected sockets are just a dispatch sources that can call blocks on a queue when stuff happens. I believe there's a wrapper for this on github called AsyncSocket that abstracts things a bit (on my phone so I don't have all of my notes). <span></span><br>
<br>On Saturday, July 14, 2012, Joe Armstrong  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I want the following:<br>
<br>
   - Client in erlang (easy)<br>
  - Server in objective C (I'm thinking Mac OS-X lion - xcode 4.2 - cocoa)<br>
  -  socket communication<br>
<br>
[[ I'm a complete beginner with xcode/objective C ]]<br>
<br>
Has anybody written a simple objective C client that opens a port<br>
waits for a message then executes a callback. This should be non-blocking<br>
and be integrated with the "standard" dispatcher top-loop.<br>
<br>
I'm confused by the profusion of classes that almost do this.<br>
<br>
Has anybody implemented this, or have pointers to a good place to start.<br>
<br>
Cheers<br>
<br>
/Joe<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'erlang-questions@erlang.org')">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote>