|
@@ -19,7 +19,7 @@ struct StartTime
|
|
|
// Function prototype
|
|
|
//==========================================
|
|
|
void ReceivedMessage(void *in, size_t len);
|
|
|
-int SendBufLen=(1024*4);//(1024*3);
|
|
|
+int SendBufLen=0;//(1024*4);//(1024*3);
|
|
|
unsigned char SendBuffer[1024*4]={0};
|
|
|
static int ConnectionEstablished=0;
|
|
|
static int TransactionMessageResend = 1; // the number of retry to submit a transaction-related message when the Central System fails to process it.
|
|
@@ -128,6 +128,7 @@ int SendData(struct lws *wsi)
|
|
|
|
|
|
n = lws_write(wsi, out + LWS_SEND_BUFFER_PRE_PADDING, len, LWS_WRITE_TEXT);
|
|
|
memset(SendBuffer, 0, len);
|
|
|
+ SendBufLen = 0;
|
|
|
|
|
|
return n;
|
|
|
}
|
|
@@ -1434,12 +1435,10 @@ int main(void)
|
|
|
{
|
|
|
queue_operation(QUEUE_OPERATION_SENT, "", "");
|
|
|
req_SendQueue = 0;
|
|
|
- lws_service(context, 0);//timeout_ms
|
|
|
}
|
|
|
|
|
|
// Check System Value
|
|
|
CheckSystemValue();
|
|
|
- lws_service(context, 0);//timeout_ms
|
|
|
|
|
|
if(GetHeartBeatWithNOResponse() >= 3)
|
|
|
{
|
|
@@ -1459,8 +1458,11 @@ int main(void)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- lws_service(context, 0);//timeout_ms
|
|
|
|
|
|
+ do
|
|
|
+ {
|
|
|
+ lws_service(context, 0);//timeout_ms
|
|
|
+ }while((SendBufLen>0) && (context!=NULL) && GetInternetConn());
|
|
|
usleep(100000);
|
|
|
}
|
|
|
pthread_join(tid_ProcQueue, NULL);
|