- if (libtcp_receive_bin(sockfd, &ret, sizeof(uint8_t)) != sizeof(uint8_t))
- throw std::runtime_error("Error al recibir ret por socket");
- if (libtcp_receive_bin(sockfd, &ttl, sizeof(uint32_t)) != sizeof(uint32_t))
- throw std::runtime_error("Error al recibir ttl por socket");
- uint8_t count;
- if (libtcp_receive_bin(sockfd, &count, sizeof(uint8_t)) != sizeof(uint8_t))
- throw std::runtime_error("Error al recibir count por socket");
- ips.clear();
- ips.reserve(count);
- for (uint8_t i = 0; i < count; ++i)
- {
- uint32_t ip;
- if (libtcp_receive_bin(sockfd, &ip, sizeof(uint32_t)) != sizeof(uint32_t))
- throw std::runtime_error("Error al recibir IPAddr por socket");
- ips.push_back(ip);
- }