20-06-2009, 01:04 AM
If you send the login packet right after trying to establish a connection, the server won't have enough time to accept the connection, which sounds like the problem in this case. You mentioned that the server sends a message after connecting; the point where the client receives that message would be a perfect time to send the login information.