[Icecast-dev] libshout nonblocking API

Brendan Cully brendan
Mon Jul 26 11:32:18 PDT 2004


I propose the following changes to the libshout API to support
nonblocking I/O:

New functions:
int shout_set_nonblocking(shout_t *self, unsigned int nonblocking):
Instructs libshout to use nonblocking I/O. Must be called before
shout_open (no switching back and forth midstream at the moment).

unsigned int shout_get_nonblocking(shout_t *self): self-explanatory.

Changed functions:
shout_get_connected:
Will now attempt to complete login if the connection is in
progress. May return additional error codes, or SHOUTERR_BUSY if the
connection still hasn't finished opening.

shout_open:
May return SHOUTERR_BUSY as a non-fatal error. In this case, the
client should call shout_get_connected() periodically until that
function stops returning SHOUTERR_BUSY.

shout_send
shout_send_raw:
May return SHOUTERR_BUSY if they couldn't send the entire buffer. In
this case, the remaining data will be queued internally. To flush
the buffer, call the function with a 0 length buffer until it stops
returning SHOUTERR_BUSY.

Comments? I've already implemented a lot of this, but it'd be good to
have some consensus before anything is announced.


More information about the Icecast-dev mailing list