I am using java-websocket library on android
client side for communicating with python
ws server. I am using above library to handle asynchronous response from server. The following are the @override
methods of websocket
class:
@Override
public void onOpen(ServerHandshake serverHandshake)
{
}
@Override
public void onMessage(String message)
{
}
public void onMessage(WebSocket webSocket, ByteBuffer byteBuffer)
{
}
@Override
public void onMessage(ByteBuffer bytes)
{
super.onMessage(bytes);
}
@Override
public void onClose(int i, String s, boolean b)
{
}
@Override
public void onError(Exception e)
{
}
When android-client
got asynchronous response from server in string format and if it exceeds over 4096 bytes, then onMessage(String)
get incomplete data. While server sends complete data. I have tested it for around 8000 bytes.
How could android-client
read all data(more than 4096 bytes) in websocket
stream ? Does anyone have face problem like this using java-websocket library?