metajack / libstrophe

The libstrophe repository has moved to https://github.com/strophe/libstrophe
http://strophe.im/libstrophe
Other
135 stars 49 forks source link

xmpp_graceful_stop(ctx,timeout) + fix for send_queue_len #34

Open ghamlin opened 11 years ago

ghamlin commented 11 years ago

xmpp_graceful_stop(ctx,timeout) waits until either all connections have a send_queue_len of zero or timeout elapses. The primary motivation is to have an easy way to signal shutdown after any enqueued messages have been sent. The previous commit, adds a one line fix to decrement send_queue_len so it contains the length of the queue.

This works for my simple program, let me know if this looks correct to you.

Garick