2025-06-20 09:25:17 +08:00
|
|
|
#include <pthread.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
#include <errno.h>
|
|
|
|
|
#include <time.h>
|
|
|
|
|
#include <queue>
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include <atomic>
|
|
|
|
|
#include "PQSMsg.h"
|
|
|
|
|
#include "client2.h"
|
|
|
|
|
#include "dealMsg.h"
|
|
|
|
|
|
2025-06-20 16:20:59 +08:00
|
|
|
SafeMessageQueue message_queue; // 全局消息队列
|
2025-06-20 09:25:17 +08:00
|
|
|
|
2025-06-20 16:20:59 +08:00
|
|
|
void process_received_message(int client_index, const char* data, size_t length) {
|
|
|
|
|
// 实际的消息处理逻辑
|
|
|
|
|
// 这里可以添加您的业务处理代码
|
|
|
|
|
printf("Processing message from client %d, size: %zu\n", client_index, length);
|
|
|
|
|
|
|
|
|
|
// 示例:解析消息并处理
|
|
|
|
|
// 注意:根据您的协议实现具体的解析逻辑
|
2025-06-20 09:25:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|