+
+ -- The feed is often unresponsive after we send out username. It
+ -- happens in a telnet session, too (albeit less frequently?),
+ -- so there might be a bug on their end.
+ --
+ -- If we dump the packets with tcpdump, it looks like their
+ -- software is getting confused: they send us some XML in
+ -- the middle of the log-in procedure.
+ --
+ -- On the other hand, the documentation at
+ -- <http://www.sportsnetworkdata.com/feeds/xml-levels.asp>
+ -- states that you can only make one connection per username to
+ -- a given host. So maybe they're simply rejecting the username
+ -- in an unfriendly fashion. In any case, the easiest fix is to
+ -- disconnect and try again.
+ --
+ login_worked <- timeout five_seconds $ log_in cfg h
+ case login_worked of
+ Nothing -> report_info "Login timed out (5s)."
+ Just _ -> loop cfg h []