Celso Martinho <[EMAIL PROTECTED]> wrote: > It seems that messenger.hotmail.com is down. I only started paying > attention recently, is this very common ? It used to be. They've gotten a lot [EMAIL PROTECTED] it up in the last few years
> celso:~$ telnet messenger.hotmail.com 1863 > Trying 207.46.104.20... > telnet: connect to address 207.46.104.20: Connection refused > telnet: Unable to connect to remote host > > So PyMSN is unable to connect. I was browsing through the code and > reading > http://www.hypothetic.org/docs/msn/notification/authentication.php and > decided to change msnw.py from: > > reactor.connectTCP('messenger.hotmail.com', 1863, dispatchFactory) > > to: > > reactor.connectTCP('baym-cs322.msgr.hotmail.com', 1863, > dispatchFactory) > > I got "baym-cs322.msgr.hotmail.com" from a tcpdump from a real MSN > client. > > I rebooted the transport, I saw from the tcpdump that it exchanged some > traffic but I still couldn't logon. Yeah, if the main server is down, the others are (in my experience) not functional. > So my newbie questions are: > > 1. Is the transport ready to work directly with a notification server > other the messenger.hotmail.com ? What happens is this: PyMSNt connects to messenger.hotmail.com, talks for a little bit, and then gets redirected to another server. I could cache the servers that we get redirected to, and then connect directly to them, but if they're full, then they'll just redirect you somewhere else. The purpose of messenger.hotmail.com seems to be only to redirect client connections to a free server. > 2. Wouldn't it be good ideia to implement alternative fallback > authentication processes like the real MSN client does ? It seem that > it first tries the last notification server it used, then the main > dispatch server and finally a web based dispach server. If messenger.hotmail.com is down, the network is down (as far as I can tell). Accessing a web based server is less likely to be reliable, and uses up more resources for the PyMSNt server. It may be useful as a fallback, but would require a lot of extra code in PyMSNt. > 3. And last: > > if(self.inited): > MSNConnection.removeMe(self) > > self.switchboardSessions = {} > dispatchFactory = DispatchFactory(self) > reactor.connectTCP('messenger.hotmail.com', 1863, > dispatchFactory) > self.notificationFactory = msn.NotificationFactory() > self.notificationFactory.userHandle = self.username > self.notificationFactory.password = self.password > self.notificationFactory.msncon = self > self.notificationFactory.protocol = Notification > self.notificationProtocol = None > > self.savedStatus = None > > self.inited = True > > debug.log("MSNConnection: \"%s\" initialised" % > (self.username)) > > I don't know too much python but isn't some error checking needed here > ? It seems to be returning success even when I know for sure that this > server can't connect to messenger.hotmail.com. heh.. Yeah, I can understand that looking a little weird. I'm using the Twisted networking framework, which is entirely asynchronous. That connectTCP call returns instantly, and there's no way to know from that function whether it will succeed or not. The callback is in the dispatchFactory class instance. I will have a look there and see what happens if it fails to connect though (whether the class gets cleaned up properly, or if it just sits there) --- James