On 05 Oct 2012, at 12:47, Santiago Bragagnolo <[email protected]> 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. As far as I know there is no such primitive. It would be very nice to have though, it is one of the building blocks to do asynchroneous IO. But this is just one way to do polling. > Maybe i need to spawn a process per socket? Indeed, this would be the classic way to do it: just do a blocking read until ConnectionTimedOut and loop. You could experiment with #isDataAvailable and/or very short timeouts to service more connections with one thread, but that won't be easy (you would be at the mercy of the primitives with their subtle platform differences). -- Sven Van Caekenberghe http://stfx.eu Smalltalk is the Red Pill
