I’m peppering this with enough keywords so that other idiots will be able to find this easily. MXit is a mobile-phone based chat system that’s very popular in South Africa (Rugby World Cup champions 2007, thank you very much; want to wine about Cueto’s “try”, then first click here). It is possible to run the MXit Java midlet on a J2ME emulator (am I saying this right?) such as mpowerplayer or microemulator. Of course this works on Windows, even the average 12 year-old MXit user can successfully follow the many guides available online and then brag about his technical prowess online to his “friends”.
Obviously, I had to get this working on Ubuntu Feisty Fawn (7.04), you really don’t have to ask why. And obviously, it Just Didn’t Work™. MXit, both versions 3.0.5 and 5.2.x, hang forever at “Registering” or “Logging in”. After much swearing and trying The Usual Solutions™, I dusted off my ethereal / wireshark, and also my trusty old tcpdump and set out analysing TCP packet dumps.
I really hate packet analysis, it’s such a pleb thing to do. Oh well, one does one’s best to forget one’s breeding. Temporarily.
It turns out that if you set the maximum TCP receive buffer to 170K (instead of the default 1M on Feisty), everything starts working again. My current hypothesis is that some of the other auto-tuned TCP parameters than rely on the max receive buffer setting, now better accommodate the small MXit packets. For those of you who still don’t understand what all of this means, run the following as root to get MXit working on Feisty:
_echo “4096 87380 174760” > /proc/sys/net/ipv4/tcprmem
To make this permanent across boots, check the man page for sysctl.conf or add the line above to your /etc/rc.local.
Let me know in the comments if this is useful. I optimistically estimate that there has to be at least one (1) other person that will run into this problem. Ever.