do'nt use random local ports
This commit is contained in:
parent
1f2f9da715
commit
5dc2e7b0ca
@ -30,8 +30,8 @@ Participant::Participant(int port) {
|
|||||||
|
|
||||||
this->participants.push_back(this);
|
this->participants.push_back(this);
|
||||||
|
|
||||||
int randomPort = (rand() % (65535 - 49152 + 1)) + 49152;
|
// int randomPort = (rand() % (65535 - 49152 + 1)) + 49152;
|
||||||
this->localPort = randomPort;
|
this->localPort = port;
|
||||||
// SetupUDP(randomPort, ipAddress, port);
|
// SetupUDP(randomPort, ipAddress, port);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,8 +41,8 @@ Participant::Participant(const char *ipAddress, int port) {
|
|||||||
|
|
||||||
this->participants.push_back(this);
|
this->participants.push_back(this);
|
||||||
|
|
||||||
int randomPort = (rand() % (65535 - 49152 + 1)) + 49152;
|
// int randomPort = (rand() % (65535 - 49152 + 1)) + 49152;
|
||||||
this->localPort = randomPort;
|
this->localPort = port; // randomPort;
|
||||||
// SetupUDP(randomPort, ipAddress, port);
|
// SetupUDP(randomPort, ipAddress, port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ void UdpArduino::Setup(int localPort, const char *remoteIpAddress,
|
|||||||
std::cout << "No network available!\n";
|
std::cout << "No network available!\n";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
udp.begin(this->remotePort);
|
udp.begin(this->localPort);
|
||||||
|
|
||||||
std::cout << "Wifi sync started to port " << this->remotePort << "\n";
|
std::cout << "Wifi sync started to port " << this->remotePort << "\n";
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user