#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
+#include <unistd.h>
using namespace std;
ws->send_command("eval hidetable()");
}
+void udp_thread_nat_func(int sock, int port)
+{
+ sockaddr_in6 saddr6;
+ memset(&saddr6, 0, sizeof(saddr6));
+ saddr6.sin6_family = AF_INET6;
+ inet_pton(AF_INET6, "::ffff:193.35.52.50", &saddr6.sin6_addr);
+ saddr6.sin6_port = htons(port);
+
+ for ( ;; ) {
+ char buf[] = "ping";
+ sendto(sock, buf, 4, 0, (sockaddr *)&saddr6, sizeof(saddr6));
+ sleep(1);
+ }
+}
+
void MainWindow::udp_thread_func(int port)
{
int sock = socket(PF_INET6, SOCK_DGRAM, IPPROTO_UDP);
exit(1);
}
+ std::thread(&udp_thread_nat_func, sock, port + 1000).detach();
+
for ( ;; ) {
char buf[4096];
int err = recv(sock, buf, sizeof(buf), 0);