Took too long to log in...?

Ok so when I run the server, everything loads up fine. My server shows up in the list and it says it's online. Then when I try to connect to it, it says end of stream. Also, when I try connecting to localhost, it says: Disconnected by server: Took too long to log in. Can anyone help?