If you are having trouble connecting to your minecraft server it may be due to the authentication server on minecraft.net either being down or overloaded.
Various errors you may get are: "Response Code 503" or "End Of Stream" or "Took too long to login" or "Failed to verify Username", "java.io.IOException: Server returned HTTP response code: 503 for URL:", "Failed to Login", "Failed to verify username, session authentication server unavailable, "Server returned HTTP response code: 504 for URL: http://session.minecraft.net/game/checkserver.jsp?".
Please read what Notch is trying to do about this: http://notch.tumblr.com/post/2812089385/the-web-server-is-struggling-were-migrating
The only thing you can do to avoid this problem temporarily is to set online-mode=true to online-mode=false in your server.properties file.
However as this leaves your server vulnerable to possible attacks this is not recommended as a long term solution.