I have used your example code to make tcp calls to my server, initially it went well, but problem is it keeps repeating the call and returns incomplete data.
I have used this example
https://github.com/reneweb/AndroidAsyncSocketExamples/blob/master/app/src/main/java/com/github/reneweb/androidasyncsocketexamples/tcp/Client.java