You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i used blow code on server
for(//about 50 counts){
socket.send(tempByte);//tempByte is a object's byte array that implement Serializable
}
But my server will call GC not stop, when my client received all data.why?
And I can't use socket.send(byte[] data) again for my client.
for example:
D/dalvikvm﹕ GC_FOR_ALLOC freed 7425K, 41% free 8777K/14848K, paused 14ms, total 14ms
D/dalvikvm﹕ GC_FOR_ALLOC freed 7425K, 41% free 8777K/14848K, paused 14ms, total 14ms
D/dalvikvm﹕ GC_FOR_ALLOC freed 7425K, 41% free 8777K/14848K, paused 14ms, total 14ms
When i used blow code on server
for(//about 50 counts){
socket.send(tempByte);//tempByte is a object's byte array that implement Serializable
}
But my server will call GC not stop, when my client received all data.why?
And I can't use socket.send(byte[] data) again for my client.
for example:
D/dalvikvm﹕ GC_FOR_ALLOC freed 7425K, 41% free 8777K/14848K, paused 14ms, total 14ms
D/dalvikvm﹕ GC_FOR_ALLOC freed 7425K, 41% free 8777K/14848K, paused 14ms, total 14ms
D/dalvikvm﹕ GC_FOR_ALLOC freed 7425K, 41% free 8777K/14848K, paused 14ms, total 14ms
client:
webSocket.setDataCallback(new DataCallback() {
@OverRide
public void onDataAvailable(DataEmitter emitter, ByteBufferList bb) {
ByteBuffer[] byteBufferArray = bb.getAllArray();
LogUtil.e(TAG, "Server receive: ByteBufferList size:" + byteBufferArray.length);
ArrayList list = new ArrayList();
for (ByteBuffer byteBuffer : byteBufferArray) {
byte[] bytes = byteBuffer.array();
AppInfo appInfo = AppInfo.ByteToObject(bytes);
//save file
//Utils.getFile(appInfo.getAppIcon(), "/mnt/sdcard/" + appInfo.getPackageName() + ".png");
list.add(appInfo);
}
bb.recycle();
semaphore.release();
}
});
server:
ArrayList<byte[]> list = (ArrayList<byte[]>) bytes;
for (byte[] tempByte : list) {
socket.send(tempByte);
}
The text was updated successfully, but these errors were encountered: