[Spread-users] how to check for available messages

Ned Konz ned at bike-nomad.com
Thu Mar 18 16:50:43 EST 2004

On Thursday 18 March 2004 5:19 am, Joerg F. Wittenberger wrote:
> I'm interested to try spread for Askemos' broadcasting neeeds
> (www.askemos.org).  From the documentation I see, that SP_receive will
> block if there's no message waiting.  I have a hard time to cope with
> that.  Is there any API, which can check, whethere a following
> SP_receive would block (simillar to select(2) or poll(2)).

You're in luck: the mbox descriptor used by the spread client is, in fact, a 
file descriptor and you can call select() on it.

This is what the Python and Squeak Spread libraries do, anyway.

Ned Konz

More information about the Spread-users mailing list