}
// Wait for RegisterUDP reply.
synchronized (udpRegistrationLock) {
while (!udpRegistered && System.currentTimeMillis() < endTime) {
RegisterUDP registerUDP = new RegisterUDP();
registerUDP.connectionID = id;
udp.send(this, registerUDP, udpAddress);
try {
udpRegistrationLock.wait(100);
} catch (InterruptedException ignored) {