Re: [Standards] Network IO best practices

2018-06-11 Thread Dave Cridland
On 10 June 2018 at 06:09, Daniel Corbe wrote: > 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. > > Eeeek. > Is

Re: [Standards] Network IO best practices

2018-06-11 Thread Andrey Gursky
Hi Daniel, On 2018-06-10 07:09, Daniel Corbe wrote: Hi, 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

Re: [Standards] Network IO best practices

2018-06-11 Thread Cramer, E.R. (Eelco)
I’m also working on a project involving Go and XMPP but I’m creating a server component (XEP-0114). I’m reusing most of this project https://github.com/sheenobu/go-xco but I forked a fork of that project that adds some features (like asynchronous sending and receiving of messages). It works

Re: [Standards] Network IO best practices

2018-06-10 Thread Sam Whited
On Sun, Jun 10, 2018, at 00:09, Daniel Corbe wrote: > 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. FWIW, I have an incomplete (though hopefully not

Re: [Standards] Network IO best practices

2018-06-10 Thread Ivan Vučica
If you were waiting for CR/CRLF, you would similarly be reading “one byte at a time” (probably buffering first and then seeing whether the buffer contains a newline?). What you are looking for are streaming XML parsers. You can do this in Go with encoding/xml; you will get individual tokens which

Re: [Standards] Network IO best practices

2018-06-10 Thread Tedd Sterr
I should note that this list is for XMPP Standards discussion, and development questions are more appropriately directed to the JDev list - https://mail.jabber.org/mailman/listinfo/jdev ___ Standards mailing list Info:

Re: [Standards] Network IO best practices

2018-06-10 Thread Tedd Sterr
It sounds like you're trying to take the incoming XML stream as-is and separate it into stanzas without properly parsing the XML. You will need to parse the XML anyway to make use of it, so you may as well do it as it comes in. Buffer the incoming raw data, and then parse XML components, and

[Standards] Network IO best practices

2018-06-09 Thread Daniel Corbe
Hi, 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