It's just how the accept() method works. It blocks until a connection is made. If that's not good for you you should check out NIO and java.nio.channels.Selector. This will poll until there is actually activity; a connection request, data, etc. This polling can have a timeout so you won't have to wait indefinitely.
The new socket connection will cause accept() to not wait any longer, and return the other side of the connection. Since you abort the loop immediately and the server doesn't do anything with the socket there is no code that can throw an exception. Only if you call any methods on the closed socket will an exception be thrown.