[feature][T8TSK-4] Optimize the network module, provide state buffer variables 2, short the waiting time
Change-Id: Iea4a60a48352bd8502d1c9b259df10d378fa08dd
diff --git a/lib/liblynq-data/lynq_data.cpp b/lib/liblynq-data/lynq_data.cpp
index fc0c4a2..677fb5f 100755
--- a/lib/liblynq-data/lynq_data.cpp
+++ b/lib/liblynq-data/lynq_data.cpp
@@ -262,11 +262,12 @@
}
return 0;
}
-int JumpHeader(Parcel &p,int *resp_type,int *request,int *slot_id,int *error)
+int JumpHeader(Parcel &p,int *resp_type,int *token, int *request,int *slot_id,int *error)
{
if(p.dataAvail() > 0)
{
p.readInt32(resp_type);
+ p.readInt32(token);
p.readInt32(request);
p.readInt32(slot_id);
p.readInt32(error);
@@ -601,6 +602,7 @@
Parcel p;
lynq_client_t client;
int resp_type = -1;
+ int token;
int request = -1;
int slot_id = -1;
int error = -1;
@@ -625,7 +627,7 @@
}
get_response(lynq_client_sockfd,p);
pthread_mutex_unlock(&g_lynq_data_sendto_mutex);
- JumpHeader(p,&resp_type,&request,&slot_id,&error);
+ JumpHeader(p,&resp_type,&token,&request,&slot_id,&error);
LYINFLOG("resp_type=%d,request=%d,slot_id=%d,error_code=%d",resp_type,request,slot_id,error);
lynq_data_call_id = updateApn("default");
lynq_data_call = 1;
@@ -647,6 +649,7 @@
Parcel p;
lynq_client_t client;
int resp_type = -1;
+ int token;
int request = -1;
int slot_id = -1;
int error = -1;
@@ -687,7 +690,7 @@
}
get_response(lynq_client_sockfd,p);
pthread_mutex_unlock(&g_lynq_data_sendto_mutex);
- JumpHeader(p,&resp_type,&request,&slot_id,&error);
+ JumpHeader(p,&resp_type,&token,&request,&slot_id,&error);
LYINFLOG("resp_type=%d,request=%d,slot_id=%d,error_code=%d",resp_type,request,slot_id,error);
cleanOnceApnTable(lynq_data_call_id);
return error;
@@ -697,6 +700,7 @@
Parcel p;
lynq_client_t client;
int resp_type = -1;
+ int token;
int request = -1;
int slot_id = -1;
int error = -1;
@@ -763,7 +767,7 @@
}
get_response(lynq_client_sockfd,p);
pthread_mutex_unlock(&g_lynq_data_sendto_mutex);
- JumpHeader(p,&resp_type,&request,&slot_id,&error);
+ JumpHeader(p,&resp_type,&token,&request,&slot_id,&error);
LYINFLOG("resp_type=%d,request=%d,slot_id=%d,error_code=%d",resp_type,request,slot_id,error);
lynq_data_call_id = updateApn(apnType);
lynq_data_call = 1;
@@ -807,7 +811,7 @@
return -1;
}
get_response(lynq_client_sockfd,p);
- JumpHeader(p,&resp_type,&request,&slot_id,&error);
+ JumpHeader(p,&resp_type,&token,&request,&slot_id,&error);
LYINFLOG("resp_type=%d,request=%d,slot_id=%d,error_code=%d",resp_type,request,slot_id,error);
return error;
}
@@ -817,7 +821,8 @@
Parcel p;
lynq_client_t client;
int resp_type = -1;
- int request = -1;
+ int token;
+ int request = -1;
int slot_id = -1;
int error = -1;
int version =0;
@@ -843,7 +848,7 @@
}
get_response(lynq_client_sockfd,p);
pthread_mutex_unlock(&g_lynq_data_sendto_mutex);
- JumpHeader(p,&resp_type,&request,&slot_id,&error);
+ JumpHeader(p,&resp_type,&token,&request,&slot_id,&error);
LYINFLOG("resp_type=%d,request=%d,slot_id=%d,error_code=%d",resp_type,request,slot_id,error);
p.readInt32(&version);
if(version==11)