OutputThread = new UDPSenderThread(ip, 0, block, pausems); // Sender socket binded to 0 OutputThread->GetSocketReady(); OutputThread->Begin(); InputThread = new UDPReceiverThread(ip, OutputThread->GetLocalRawPort(), block, pausems); // Bind receiving socket to the local port that was assigned to the sender socket InputThread->Begin();