Вот шаги и конфигурации, которые я пробовал на данный момент:
Код сервера (C++) :
Код: Выделить всё
#include
#include
#include
#include
#include
using namespace std;
struct MessageHeader {
uint8_t header_length;
uint8_t message_type;
uint32_t timestamp;
uint16_t sender_id;
uint16_t receiver_id;
uint32_t message_id;
uint16_t payload_length;
uint16_t checksum;
};
uint16_t calculateChecksum(const uint8_t* data, size_t length) {
uint32_t sum = 0;
for (size_t i = 0; i < length; ++i) {
sum += data[i];
}
return static_cast(~sum);
}
void handleClient(int client_fd) {
MessageHeader header;
while (read(client_fd, &header, sizeof(header)) > 0) {
switch (header.message_type) {
case 1: // ON_REQ
cout
Подробнее здесь: [url]https://stackoverflow.com/questions/78781218/client-server-connection-timeout-in-wsl[/url]
Мобильная версия