Possible Duplicate:
java socket / output stream writes : do they block?
When writing to a DataOutputStream attached to a Socket, for example in a Server-to-Client connection, does the .writeInt() method wait for the data to be written, if, for example, the Client/Server connection is very slow – would this make the .writeInt() method wait?
It will wait until
For this reason it is a good idea to Buffer the stream (to reduce the cost of system calls).
No matter what you do you have the potential to be blocked as the connection is too slow.