The ServerSocket blocks until it receives a connection.
I don't know what the DatagramSocket does.

Do you have a small simple client/server program that would demonstrate this problem?