[Spread-users] how to check for available messages

Tim Peters tim.one at comcast.net
Thu Mar 18 16:47:58 EST 2004

[Joerg F. Wittenberger]
> 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)).

A Spread mailbox *is* a socket handle, and, e.g., can be passed to select()
like any other socket handle.  There's also the SP_poll() function, but it's
not particularly good even for polling because it doesn't return an error
code if the client has gotten disconnected (it returns 0 then, so a "polling
loop" just using SP_poll() will never know it if the client gets

More information about the Spread-users mailing list