separate PIEthernet::Address to PINetworkAddress, typedef PIEthernet::Address to PINetworkAddress and mark as deprecated
PIValueTree new attributes for File and Dir
This commit is contained in:
@@ -119,7 +119,7 @@ void PIPeer::PeerData::setDist(int dist) {
|
||||
}
|
||||
|
||||
|
||||
PIPeer::PeerInfo::PeerAddress::PeerAddress(const PIEthernet::Address & a, const PIEthernet::Address & m): address(a), netmask(m) {
|
||||
PIPeer::PeerInfo::PeerAddress::PeerAddress(const PINetworkAddress & a, const PINetworkAddress & m): address(a), netmask(m) {
|
||||
ping = -1.;
|
||||
wait_ping = false;
|
||||
last_ping = PISystemTime::current(true);
|
||||
@@ -150,9 +150,9 @@ void PIPeer::PeerInfo::destroy() {
|
||||
}
|
||||
|
||||
|
||||
PIEthernet::Address PIPeer::PeerInfo::fastestAddress() const {
|
||||
PINetworkAddress PIPeer::PeerInfo::fastestAddress() const {
|
||||
double mp = -1.;
|
||||
PIEthernet::Address ret;
|
||||
PINetworkAddress ret;
|
||||
piForeachC(PeerAddress & a, addresses) {
|
||||
if (a.ping <= 0.) continue;
|
||||
if ((mp < 0) || (mp > a.ping)) {
|
||||
@@ -356,7 +356,7 @@ void PIPeer::initMBcasts(PIStringList al) {
|
||||
eth_tcp_cli.startThreadedRead();
|
||||
if (eths_mcast.isEmpty() && eths_bcast.isEmpty() && !eth_lo.isOpened())
|
||||
piCoutObj << "Warning! Can`t find suitable network interface for multicast receive, check for exists at least one interface with "
|
||||
"multicasting enabled!";
|
||||
"multicasting enabled!";
|
||||
// piCoutObj << "initMBcasts ok";
|
||||
}
|
||||
|
||||
@@ -474,7 +474,7 @@ bool PIPeer::dataRead(const uchar * readed, ssize_t size) {
|
||||
eth_mutex.lock();
|
||||
// piCout << "dataRead lock";
|
||||
if (type == 5) { // ping request
|
||||
PIEthernet::Address addr;
|
||||
PINetworkAddress addr;
|
||||
PISystemTime time;
|
||||
ba >> to >> from >> addr >> time;
|
||||
// piCout << "ping request" << to << from << addr;
|
||||
@@ -497,7 +497,7 @@ bool PIPeer::dataRead(const uchar * readed, ssize_t size) {
|
||||
return true;
|
||||
}
|
||||
if (type == 6) { // ping request
|
||||
PIEthernet::Address addr;
|
||||
PINetworkAddress addr;
|
||||
PISystemTime time, ptime, ctime = PISystemTime::current(true);
|
||||
ba >> to >> from >> addr >> time;
|
||||
// piCout << "ping reply" << to << from << addr;
|
||||
@@ -725,7 +725,7 @@ bool PIPeer::mbcastRead(const uchar * data, ssize_t size) {
|
||||
|
||||
|
||||
bool PIPeer::sendToNeighbour(PIPeer::PeerInfo * peer, const PIByteArray & ba) {
|
||||
PIEthernet::Address addr = peer->fastestAddress();
|
||||
PINetworkAddress addr = peer->fastestAddress();
|
||||
// piCout << "[PIPeer] sendToNeighbour" << peer->name << addr << ba.size_s() << "bytes ...";
|
||||
send_mutex.lock();
|
||||
bool ok = eth_send.send(addr, ba);
|
||||
@@ -1025,9 +1025,9 @@ void PIPeer::initNetwork() {
|
||||
piMSleep(100);
|
||||
// piCoutObj << self_info.addresses.size();
|
||||
self_info.addresses.clear();
|
||||
PIVector<PIEthernet::Address> al = PIEthernet::allAddresses();
|
||||
PIVector<PINetworkAddress> al = PIEthernet::allAddresses();
|
||||
PIStringList sl;
|
||||
for (const PIEthernet::Address & a: al) {
|
||||
for (const PINetworkAddress & a: al) {
|
||||
sl << a.ipString();
|
||||
}
|
||||
initEths(sl);
|
||||
|
||||
Reference in New Issue
Block a user