[Standards] Network IO best practices

Daniel Corbe dcorbe at gmail.com
Sun Jun 10 05:09:59 UTC 2018


First time implementor of anything XMPP-related, much less outside of the  
use of a library for dealing with XMPP.

The chosen language here is Go and the few XMPP libraries that exist in our  
world are hilariously incomplete.   So I’m stuck implementing a library for  
my application from scratch.

So here goes my question.

I’m watching my XMPP client talk to a server, and there doesn’t seem to be  
any delineation between stanzas.   It’s just a byte stream of XML.   No CR,  
CRLF or LF to indicate that one side of the conversation is finished  
sending messages.

How do people typically deal with this in other languages?

Because it would seem to me as if one would need to read the entire stream  
one byte at a time and wait for valid input before passing the message off  
to a parser.   IE, I’m looking for that final closing > before I can reply.

Is there a better way to go about it that isn’t going to incur a massive  
performance penalty?

More information about the Standards mailing list