On Fri, Oct 05, 2012 at 12:47:55PM +0200, Santiago Bragagnolo wrote:
> Hi guys, theres something like the select or poll C functions in order to
> wait for incoming-data from a set of sockets? I searched at the list and in
> the pharo by example book without any success and i didn't find a method
> named poll / select ( select in terms of sockets ) in the image.
> 
> Maybe i need to spawn a process per socket?
> 

See AioEventHandlerExample and AioEventHandlerTestCase in OSProcess. The
primitives are in AioPlugin (http://www.squeaksource.com/AioPlugin/), which
connects to the low level select() implementation that Ian Piumarta developed
for the unix VMs. I think that this works on Mac and on Cog VMs also if
the plugin is provided (but it will not work on Windows).

Note that the socket that you use in the image may already be using select()
to respond to incoming data.

HTH,
Dave


Reply via email to