try
{
+ Log.v(TAG, " ===== receive_multi() =====");
int receive_message_buffer_size = BUFFER_SIZE;
byte[] byte_array = new byte[receive_message_buffer_size];
InputStream is = socket.getInputStream();
lenlen = ((((int) byte_array[15]) & 0xff) << 24) + ((((int) byte_array[14]) & 0xff) << 16) + ((((int) byte_array[13]) & 0xff) << 8) + (((int) byte_array[12]) & 0xff);
packetType = (((int)byte_array[16]) & 0xff);
}
- Log.v(TAG, " --- [[[ RECEIVED LARGE BLOCK MESSAGE : " + lenlen + " bytes. ]]] --- TYPE : " + packetType);
+ Log.v(TAG, " --- parseDataLength() length: " + lenlen + " TYPE: " + packetType + " read_bytes: " + read_bytes);
}
catch (Exception e)
{
lenlen = ((((int) byte_array[15]) & 0xff) << 24) + ((((int) byte_array[14]) & 0xff) << 16) + ((((int) byte_array[13]) & 0xff) << 8) + (((int) byte_array[12]) & 0xff);
packetType = (((int) byte_array[16]) & 0xff);
}
- Log.v(TAG, " --- <<< RECEIVED LARGE BLOCK MESSAGE : " + len + " bytes. (" + byte_array.length + " bytes.)" + " lenlen : " + lenlen + " >>> --- TYPE : " + packetType);
+ Log.v(TAG, " --- RECEIVED MESSAGE : " + len + " bytes (BUFFER: " + byte_array.length + " bytes)" + " length : " + lenlen + " TYPE : " + packetType + " --- ");
if (lenlen == 0)
{
// データとしては変なので、なにもしない
}
else if (id == objectId + 2)
{
- Log.v(TAG, " RECEIVED : " + id);
+ Log.v(TAG, " TransferComplete() RECEIVED : " + id + " (" + objectId + ") size : " + target_image_size);
// end of receive sequence.
callback.onCompleted();
+ received_remain_bytes = 0;
+ received_total_bytes = 0;
target_image_size = 0;
objectId = 0;
callback = null;
// 受信したデータから、通信のヘッダ部分を削除する
byte[] body = cutHeader(rx_body);
int length = (body == null) ? 0 : body.length;
- Log.v(TAG, " onReceiveProgress() " + currentBytes + "/" + totalBytes + " (" + length + " bytes.) : image : " + target_image_size);
+ Log.v(TAG, " onReceiveProgress() " + currentBytes + "/" + totalBytes + " (" + length + " bytes.)");
callback.onProgress(body, length, new IProgressEvent() {
@Override
public float getProgress() {
{
// データを最初に読んだとき。ヘッダ部分を読み飛ばす
data_position = (int) rx_body[0] & (0xff);
+ Log.v(TAG, " FIRST DATA POS. : " + data_position);
+ //SimpleLogDumper.dump_bytes(" [sss]", Arrays.copyOfRange(rx_body, 0, (64)));
}
else if (received_remain_bytes > 0)
{