Closed i8beef closed 2 years ago
Granted that you don't want a roster and want to access IqRequest functionality your example looks fine.
The XmlReader in ReadRootElement() doesn't seem to be able to read whats in the stream. Maybe try putting a breakpoint around there and have a look at whats in the stream object at that point.
So following through the logic here, it looks like the code here is:
That doesn't seem right to me... When I do that in a console app, it immediately kicks me out.
Yeah, It's not right. I knew the library dropped the initial connection when the logon method is called. This is because it was easier to reconnect with credentials then to authentication handshake separately. I didn't realise it would do it if you've given the ctor it credentials. I personally threw a trycatch around the authenticate method so I could do my stuff. I'll take a look at it when it's not 11pm, also if I make a pull request it might not make it in straight away.
It could be worth you forking the project and helping fix it if you're definitely sticking with this library. Although I'd suggest checking out ubiety/xmpp first if you haven't yet.
Cleaning my old tickets, I ended up implementing my own socket based approach to parsing the XMPP stream outside this library.
Ok, this is a little different and if I'm too far out of spec for this library that's fine. Hoping someone might be able to point me to what I'm doing wrong.
I'm playing with communicating with a Logitech Harmony Hub. It runs an XMPP server on 5222 on the device. There is some preamble auth ticket negotiation done before the actual login attempt through XMPP, which I have working ok, but when I attempt to actually connect, I'm getting an XmppException, with an inner exception coming from the StreamParser during the login attempt, from the XmlStreamReader of "Root element is missing.".
Login type should be XMPP SASL PLAIN.
Basics of what I'm attempting to recreate are here: https://github.com/jterrace/pyharmony/blob/master/PROTOCOL.md
at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.ParseDocumentContent() at System.Xml.XmlTextReaderImpl.Read() at Sharp.Xmpp.Core.StreamParser.ReadRootElement() at Sharp.Xmpp.Core.StreamParser..ctor(Stream stream, Boolean leaveOpen) at Sharp.Xmpp.Core.XmppCore.InitiateStream(String hostname) at Sharp.Xmpp.Core.XmppCore.Authenticate(IEnumerable`1 mechanisms, String username, String password, String hostname) at Sharp.Xmpp.Core.XmppCore.SetupConnection(String resource) at Sharp.Xmpp.Core.XmppCore.Connect(String resource)