I am experiencing a strange situation. I have two applications: client side socket in Android and Java socket server runs the server in the context of application startup. Between the client and the server are sent using JSON STRING URLEncoder in each field that is to avoid string parsing to JSON. If sent from client to server in JSON STRING reached only 1 post. When I try to send the second is not sent to the server. It is somewhere you know. Now if STRING shipping without any special formatting eg ABCDEFG12331 always arrive at the server.
example how client sent or server response:
byte[] data = strText.getBytes("UTF-8");
DataOutputStream d = new DataOutputStream(wsSocket.getOutputStream());
d.write(data);
d.flush();
example how client read or server read
int maxBuffer = Math.max(wsIS.available(), 8192);
byte[] buffer = new byte[maxBuffer];
int size = wsIS.read(buffer);
if (size == -1) {
break;
}
StringBuilder str = new StringBuilder();
str.append(new String(buffer, "UTF-8").substring(0, size).trim());