[Platemail-developer] IMAP concurrent connections
Status: Pre-Alpha
Brought to you by:
batneil
|
From: Neil C. <ba...@th...> - 2005-03-24 02:35:20
|
Well well. The bug I thought I had back when I last hacked Platemail turns out not to be a bug as such, but I think I still need to find a nice solution, so I'd appreciate any input. The last time I was working on it, I was trying to finish off the IMAP support. I hit problems when I tried to sync with a account that had more than one or two folders in it (specifically, javamail threw an exception and sulked). My first thought was that javamail wasn't clever enough to manage different connections for each folder I wanted to monitor, and I was getting into an odd state while trying to mess with multiple folders at once in the same connection. That theory lasted until today, when I finally found enough information on javamail (hiding in the javamail documentation, of all places - hardly fair) to dispel this and give me renewed hope in javamail. The second theory was that javamail only allowed a limited number of connections, which isn't really true either. After trying to replicate the behaviour with a few telnet sessions, I realised that the IMAP server was just rejecting connections. It turns out that it has a limit of 4 connections from a single IP. Javamail is quite happy to work around this (I think, although I don't know what minimum number it can work with), and the problem was that when running Platemail with KMail open as well made me run out of connections. Courier is (easily) configurable in this respect, but my hosts didn't seem too keen on changing it for me, which is probably not too unreasonable. However, it seems unlikely that there is a way to ask the server how many connections you're likely to able to get away with, and even less likely that you could trust such a figure if there was. Given all this, is there any clean way of handling a case where you can only open a restricted number of connections apart from just allowing connections to fail and attempting to recover? Neil |