iSocket code for login example by Mike Taylor