*/
//---------------------------------------------------------------------------
-#include <netdb.h>
-#include <arpa/inet.h>
-#include <unistd.h>
+
+#include "stg/netunit.h"
+#include "stg/common.h"
#include <cstdio>
+#include <cerrno>
#include <cstring>
-#include "netunit.h"
-#include "common.h"
+#include <netdb.h>
+#include <arpa/inet.h>
+#include <unistd.h>
//---------------------------------------------------------------------------
ret = recv(outerSocket, buffer, strlen(OK_HEADER), 0);
if (ret <= 0)
{
+ printf("Receive header answer error: '%s'\n", strerror(errno));
errorMsg = RECV_HEADER_ANSWER_ERROR;
return st_recv_fail;
}
ret = recv(outerSocket, buffer, strlen(OK_LOGIN), 0);
if (ret <= 0)
{
+ printf("Receive login answer error: '%s'\n", strerror(errno));
errorMsg = RECV_LOGIN_ANSWER_ERROR;
return st_recv_fail;
}
ret = recv(outerSocket, buffer, strlen(OK_LOGINS), 0);
if (ret <= 0)
{
+ printf("Receive secret login answer error: '%s'\n", strerror(errno));
errorMsg = RECV_LOGIN_ANSWER_ERROR;
return st_recv_fail;
}
ret = recv(outerSocket, &bufferS[n++], 1, 0);
if (ret <= 0)
{
+ printf("Receive data error: '%s'\n", strerror(errno));
close(outerSocket);
errorMsg = RECV_DATA_ANSWER_ERROR;
return st_recv_fail;
Decrypt(buffer, bufferS, &ctx);
buffer[ENC_MSG_LEN] = 0;
+ printf("%s", buffer);
+
answerList.push_back(buffer);
for (int j = 0; j < ENC_MSG_LEN; j++)
{
if (buffer[j] == 0)
{
+ printf("\n");
if (RxCallBack)
if (st_ok != RxCallBack(dataRxCallBack, &answerList))
- {
return st_xml_parse_error;
- }
return st_ok;
}
}