What is Megaphone?

What is Megaphone?
The Megaphone project is about enhancing open source chat software. Specifically, the goal is to allow ejabberd to support 1,000,000 simultaneous users. See The Plan page for more details on how I plan to solve this problem. See the About this Blog page for more details on why I created this blog.

Sunday, December 18, 2011

mod_megaphone

Previously
  • I started analyzing the logfiles and ejabberd BOSH code.
  • I identified a juncture where I needed to decide whether to modify ejabberd BOSH or create a new and independent module.
I've decided to create an independent module.  It will be based largely on the existing BOSH module, however.  This approach allows me to use the existing BOSH module as a standard to compare against the changes that I am making in order to get megaphone to work.

I've started coding up mod_megaphone and even hooked it up to ECM.  A quick aside:

<insane-cackling>
IT'S ALIVE!!!  DO YOU HEAR ME IGOR?!  IT'S ALIIIIIVE!!!  MUHAHAHAHA!
<insane-cackling>

The problem is that it doesn't yet understand how to demultiplex data - remember that the packets coming from ECM have the format:

    <packet length>|<connection ID>|<contents>

Whereas the (converted) version of the ejabberd BOSH module expects to see just

    <content>

So the next order of business is to parse out the packet length and the connection ID.

A more subtle problem is that the entire packet might not arrive in one TCP delivery; or a single receive might get parts of several packets or even more than one packet.  To coin a phrase, this application needs buffering.

So to summarize, my todo list contains:

  • Create a simple buffering scheme for mod_megaphone
  • Add demultiplexing/packet parsing to mod_megaphone

No comments:

Post a Comment