Improve master efficiency by using asynchronous message processing

This commit is contained in:
yuanyuanxiang
2025-12-05 17:40:12 +01:00
parent 8c45ae17a8
commit 001f0682ae
15 changed files with 190 additions and 163 deletions

View File

@@ -11,7 +11,7 @@
#ifdef _DEBUG
#define SessionLog(p) ServiceWriteLog(p, "C:\\SessionMonitor.log")
#else
#define SessionLog(p)
#define SessionLog(p)
#endif
// ǰ<><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
@@ -91,18 +91,18 @@ static void AgentArray_RemoveAt(AgentProcessArray* arr, size_t index)
// ============================================
void ServiceWriteLog(const char* message, const char* filename)
{
FILE* f;
SYSTEMTIME st;
FILE* f;
SYSTEMTIME st;
f = fopen(filename, "a");
if (f) {
GetLocalTime(&st);
fprintf(f, "[%04d-%02d-%02d %02d:%02d:%02d] %s\n",
st.wYear, st.wMonth, st.wDay,
st.wHour, st.wMinute, st.wSecond,
message);
fclose(f);
}
f = fopen(filename, "a");
if (f) {
GetLocalTime(&st);
fprintf(f, "[%04d-%02d-%02d %02d:%02d:%02d] %s\n",
st.wYear, st.wMonth, st.wDay,
st.wHour, st.wMinute, st.wSecond,
message);
fclose(f);
}
}
// ============================================