The task is simple: to communicate with another program that receives and transmits UDP packets through various network devices.

The problem is that it cannot prescribe IP for work, and she herself suggests a list of existing devices and 127.0.0.1 is not on this list.

Is it possible to somehow configure the Python socket, so that a third-party program can see it as an interface with its IP?

Or maybe other methods in Python exist?


Here it is done on the same in one working program

hpsdrSocket = new QUdpSocket(this); hpsdrSocket->bind(1024, QUdpSocket::ShareAddress); connect(hpsdrSocket, SIGNAL(readyRead()), this, SLOT(readHpsdrUDPData())); 
  • Where does she get the list? You can add a routing rule and redirect all traffic to the address you need. - Mikhail Vaysman
  • Apparently there is some kind of interface enumerator that lists the existing ones, and by the way, there are also virtual interfaces that are not physically on the computer. That is what needs to be done. There is a program that works as it should, I can see how it is done there. - Renew
  • and on which OS will it all work? - Mikhail Vaysman
  • It should be multiplatform, but the preference is Winda. - Renew
  • This is how it was done on the same working program hpsdrSocket = new QUdpSocket (this); hpsdrSocket-> bind (1024, QUdpSocket :: ShareAddress); connect (hpsdrSocket, SIGNAL (readyRead ()), this, SLOT (readHpsdrUDPData ())); - Renew

0