Changeset 31 in pacpussensors for trunk/PacpusSocket
- Timestamp:
- Jan 17, 2014, 6:18:04 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/PacpusSocket/PacpusSocket.cpp
r21 r31 90 90 { 91 91 if (udpSocket_->bind(QHostAddress::Any, port2bind_, QUdpSocket::DontShareAddress)) 92 qDebug() << "Socket bound for server on port " << port2bind_;92 qDebug() << "Socket bound for server on port " << port2bind_; 93 93 else 94 qWarning() << "Failed to bind socket on port " << port2bind_;94 qWarning() << "Failed to bind socket on port " << port2bind_; 95 95 } 96 96 else if (socketType_ == "client") 97 97 { 98 98 if (udpSocket_->bind(QHostAddress::Any, port2send_ + 1, QUdpSocket::DontShareAddress)) 99 qDebug() << "Socket bound for client on port " << port2send_ + 1;99 qDebug() << "Socket bound for client on port " << port2send_ + 1; 100 100 else 101 qWarning() << "Failed to bind socket" << port2send_ + 1;101 qWarning() << "Failed to bind socket" << port2send_ + 1; 102 102 } 103 103 … … 113 113 { 114 114 if ((sent = udpSocket_->writeDatagram(frame.toLocal8Bit(), address2send_, port2send_)) == -1) 115 qDebug() << "Failed to send the frame: " << address2send_ << port2send_ << frame << endl;116 else117 qDebug() << "TO NETWORK:" << address2send_ << port2send_ << frame << "size" << sent;115 qDebug() << "Failed to send the frame: " << address2send_ << port2send_ << frame << endl; 116 //else 117 //qDebug() << "TO NETWORK:" << address2send_ << port2send_ << frame << "size" << sent; 118 118 } 119 119 else if (socketType_ == "server") … … 123 123 if ((sent = udpSocket_->writeDatagram(frame.toLocal8Bit(), listClients[i]->getAddress(), listClients[i]->getPort())) == -1) 124 124 qDebug() << "Failed to send the frame: " << listClients[i]->getAddress() << listClients[i]->getPort() << frame << endl; 125 else126 qDebug() << "TO NETWORK:" << listClients[i]->getAddress() << listClients[i]->getPort() << frame << "size" << sent;125 //else 126 //qDebug() << "TO NETWORK:" << listClients[i]->getAddress() << listClients[i]->getPort() << frame << "size" << sent; 127 127 } 128 128 } … … 137 137 { 138 138 if ((sent = udpSocket_->writeDatagram(frame, address2send_, port2send_)) == -1) 139 qDebug() << "Failed to send the frame: " << address2send_ << port2send_ << frame << endl;140 else141 qDebug() << "TO NETWORK:" << address2send_ << port2send_ << frame << "size" << sent;139 qDebug() << "Failed to send the frame: " << address2send_ << port2send_ << frame << endl; 140 //else 141 //qDebug() << "TO NETWORK:" << address2send_ << port2send_ << frame << "size" << sent; 142 142 } 143 143 else if (socketType_ == "server") … … 145 145 for (int i = 0; i < listClients.size(); i++) 146 146 { 147 if ((sent = udpSocket_->writeDatagram(frame, listClients[i]->getAddress(), listClients[i]->getPort())) == -1)148 149 else150 147 if ((sent = udpSocket_->writeDatagram(frame, listClients[i]->getAddress(), listClients[i]->getPort())) == -1) 148 qDebug() << "Failed to send the frame: " << listClients[i]->getAddress() << listClients[i]->getPort() << frame << endl; 149 //else 150 //qDebug() << "TO NETWORK:" << listClients[i]->getAddress() << listClients[i]->getPort() << frame << "size" << sent; 151 151 } 152 152 }
Note:
See TracChangeset
for help on using the changeset viewer.