Hello

I’m making an application with an UDP client/server communication.
The client has to open the 3301 port on his router to receive the socket. (and the server has to open the 3300, but that is not importante)
And I would like to know how I could receive the socket on the PC's client without this opening port.

Server Side :
-Listening
Qt Code:
  1. m_udpSocket = new QUdpSocket;
  2. m_udpSocket->bind(QHostAddress::Any, 3300, QUdpSocket::ShareAddress);
  3. connect(m_udpSocket, SIGNAL(readyRead()), this, SLOT(get()));
To copy to clipboard, switch view to plain text mode 

-Sending
Qt Code:
  1. QUdpSocket udpSocket;
  2. udpSocket.bind(3301); // I don't know if that is important
  3. udpSocket.writeDatagram(datagram, ip, 3301);
To copy to clipboard, switch view to plain text mode 


Client Side :
-Listening
Qt Code:
  1. m_serverAdress = new QHostAddress("**.**.***.**");
  2.  
  3. m_udpSocket = new QUdpSocket;
  4. m_udpSocket->bind(QHostAddress::Any, 3301, QUdpSocket::ShareAddress); /// if I put *m_serverAdress instead of QHostAddress::Any, I receive nothing even with the port openning
  5. connect(m_udpSocket, SIGNAL(readyRead()), this, SLOT(get()));
To copy to clipboard, switch view to plain text mode 

-Sending
Qt Code:
  1. m_udpSocket->writeDatagram(datagram, *m_serverAdress, 3300);
To copy to clipboard, switch view to plain text mode 


Thanks You