callbacks for success/failure on stream sending #182

Open
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
@ghost

ghost commented Jul 11, 2012

Currently, when sending any kind of stanza, you submit it to the queue and then never know what happened. It would be nice to be able to get callbacks when the stanza is actually sent over the tcp socket (or if it errors out on send). This patch also gives the ability to send extra data along to the callback so that additional state can be passed along.

Obviously, this doesn't guarantee that the message actually made it to the recipient, but it does let us know if it made it to the wire or not (as far as our program is concerned).

@legastero

This comment has been minimized.

Show comment
Hide comment
@legastero

legastero Jul 11, 2012

Collaborator

Interesting. This sounds like something that would be suited for the XEP-0198 plugin, since that lets you know the stanza made it to at least the server.

Collaborator

legastero commented Jul 11, 2012

Interesting. This sounds like something that would be suited for the XEP-0198 plugin, since that lets you know the stanza made it to at least the server.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Jul 11, 2012

XEP-0198 support would be awesome, I admit. The primary xmpp servers I deal with, though, are gtalk and facebook, neither of which seem to implement that (correct me if I've missed something). I have dialed back my expectations to only contending with the underlying network and its issues. The current socket_error event does not give enough information to determine what exactly failed. Hence if there is a network problem and a message doesn't get sent, there's currently no good way to know what didn't get sent. Therefore, the failure event. I added the success event for symmetry since I'm tracking successful and failed messages in detail.

BTW, I don't necessarily expect you guys to accept this submission. I just wanted to offer it to the project in case it solves problems other people have encountered. My situation may be somewhat unique.

ghost commented Jul 11, 2012

XEP-0198 support would be awesome, I admit. The primary xmpp servers I deal with, though, are gtalk and facebook, neither of which seem to implement that (correct me if I've missed something). I have dialed back my expectations to only contending with the underlying network and its issues. The current socket_error event does not give enough information to determine what exactly failed. Hence if there is a network problem and a message doesn't get sent, there's currently no good way to know what didn't get sent. Therefore, the failure event. I added the success event for symmetry since I'm tracking successful and failed messages in detail.

BTW, I don't necessarily expect you guys to accept this submission. I just wanted to offer it to the project in case it solves problems other people have encountered. My situation may be somewhat unique.

@bear bear added the Enhancement label Apr 12, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment