Commit 2681fcdb authored by jcacerec's avatar jcacerec
Browse files

fix port variable

parent dbd05cd5
......@@ -110,7 +110,7 @@ void UdpDataProtocol::bindSocket(QUdpSocket& UdpSocket)
/// \todo if port is already used, try binding in a different port
// QHostAddress::Any : let the kernel decide the active address
if ( !UdpSocket.bind(QHostAddress::Any, 4464, QUdpSocket::ShareAddress) ) {
if ( !UdpSocket.bind(QHostAddress::Any, mLocalPort, QUdpSocket::ShareAddress) ) {
//std::cerr << "ERROR: could not bind UDP socket" << endl;
throw std::runtime_error("Could not bind UDP socket. It may be already binded.");
......@@ -138,7 +138,7 @@ int UdpDataProtocol::receivePacket(QUdpSocket& UdpSocket, char* buf, const size_
int UdpDataProtocol::sendPacket(QUdpSocket& UdpSocket, const QHostAddress& PeerAddress,
const char* buf, const size_t n)
int n_bytes = UdpSocket.writeDatagram(buf, n, PeerAddress, 4464);
int n_bytes = UdpSocket.writeDatagram(buf, n, PeerAddress, mPeerPort);
return n_bytes;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment