Figured out the problem. On a particular host called "Donald", the sysadmin forced me to login as myself, then do a "sudo su - login2" to switch to the userid that I *really* want.
The problem was that I had forgotten to send the password when I did that, so it was sitting there waiting for it. Then it would time out with a connection still in place from the first login.
Oops.
I'll put the sockets version on hold for now since I'm getting those bizarre "Illegal Seek" errors that no one seems to be able to narrow down.