i am trying the same thing multiple threads writing to same tcp socket using synchronized block. but my threads getting stuck while taking lock in synchronized block. these keeps waiting and not coming out. looks like one of the thread got stuck in writing to tcp socket and is not coming out. how this problem can be solved?