- I decided that I wanted to get Pidgin working with NXB so that I could use Pidgin as a simple test for BOSH functionality.
- It appears that Pidgin wants to see responses to BOSH/XMPP commands that it makes in the next stanza returned.
- I modified NXB to respond to the request to create a session with the features stanza.
- Pidgin promptly decided to complain about how the authorization process worked.
- Pidgin wants the response to an authorization request to be returned in the next stanza.
- NXB currently will immediately respond to the request to start the authorization with an empty response.
- I need to modify NXB to wait for the server response to the client's authorization request before it returns a result.
- Need to find where NXB is responding to the authorization request.
- Need to stop NXB from responding.
So I tried creating a flag in the session class that signified when the auth stanza had gone through, but it didn't work. Mind you, this took me the whole day just to figure out how I might try something that did not work.
As an aside here, the whole art of software engineering can be boiled down to hitting your head against a brick wall until you make a hole that you can crawl through.
Then you get to the next wall and repeat.
This being the case, I shouldn't get frustrated with lack of progress, but I do anyway. Times like now I am wondering if maybe it wouldn't be easier to just make a connection manager on the ejabberd side that basically does nothing except accept HTTP POST messages which it forwards on to ejabberd.
You see, the big problem with ejabberd and BOSH, at least when it comes to scaling to 1,000,000 users, is that erlang consumes over 10kB per TCP connection, perhaps as much as 100kB. This is not an issue normally, but when you are talking about 1,000,000 connections, 10kB translates to 10GB of memory and 100kB per connection translates to 100GB. The idea is to use something that is more efficient with connections to deal with TCP and then multiplex the messages over one connection to ejabberd.
Theoretically, the program that deals with TCP connections would not have to be that complex. It would have to "know" about the data going across enough to wait for a complete BOSH packet before forwarding it on to ejabberd, but beyond that it should not have to know anything about the protocol, etc.
Of course, "in theory" NXB should be able to deal with Pidgin without doing anything. This brings me back to choosing whether to continue trying to modify NXB or whether to try a simple ejabberd connector.
Decisions, decisions.
No comments:
Post a Comment