do'nt use random local ports

This commit is contained in:
Pascal Serrarens 2025-02-01 20:12:24 +01:00
parent 1f2f9da715
commit 5dc2e7b0ca
2 changed files with 5 additions and 5 deletions

View File

@ -30,8 +30,8 @@ Participant::Participant(int port) {
this->participants.push_back(this);
int randomPort = (rand() % (65535 - 49152 + 1)) + 49152;
this->localPort = randomPort;
// int randomPort = (rand() % (65535 - 49152 + 1)) + 49152;
this->localPort = port;
// SetupUDP(randomPort, ipAddress, port);
}
@ -41,8 +41,8 @@ Participant::Participant(const char *ipAddress, int port) {
this->participants.push_back(this);
int randomPort = (rand() % (65535 - 49152 + 1)) + 49152;
this->localPort = randomPort;
// int randomPort = (rand() % (65535 - 49152 + 1)) + 49152;
this->localPort = port; // randomPort;
// SetupUDP(randomPort, ipAddress, port);
}

View File

@ -17,7 +17,7 @@ void UdpArduino::Setup(int localPort, const char *remoteIpAddress,
std::cout << "No network available!\n";
return;
}
udp.begin(this->remotePort);
udp.begin(this->localPort);
std::cout << "Wifi sync started to port " << this->remotePort << "\n";
#endif