general indent beautification
This commit is contained in:
@@ -33,72 +33,73 @@ BeaconHandler::~BeaconHandler()
|
||||
}
|
||||
|
||||
void BeaconHandler::beaconNotify(osiSockAddr* /*from*/, int8 remoteTransportRevision,
|
||||
TimeStamp* timestamp, GUID const & guid, int16 sequentalID,
|
||||
int16 changeCount,
|
||||
PVFieldPtr /*data*/)
|
||||
TimeStamp* timestamp, GUID const & guid, int16 sequentalID,
|
||||
int16 changeCount,
|
||||
PVFieldPtr /*data*/)
|
||||
{
|
||||
bool networkChanged = updateBeacon(remoteTransportRevision, timestamp, guid, sequentalID, changeCount);
|
||||
if (networkChanged)
|
||||
changedTransport();
|
||||
bool networkChanged = updateBeacon(remoteTransportRevision, timestamp, guid, sequentalID, changeCount);
|
||||
if (networkChanged)
|
||||
changedTransport();
|
||||
}
|
||||
|
||||
bool BeaconHandler::updateBeacon(int8 /*remoteTransportRevision*/, TimeStamp* /*timestamp*/,
|
||||
GUID const & guid, int16 /*sequentalID*/, int16 changeCount)
|
||||
GUID const & guid, int16 /*sequentalID*/, int16 changeCount)
|
||||
{
|
||||
Lock guard(_mutex);
|
||||
// first beacon notification check
|
||||
if (_first)
|
||||
{
|
||||
_first = false;
|
||||
_serverGUID = guid;
|
||||
_serverChangeCount = changeCount;
|
||||
_first = false;
|
||||
_serverGUID = guid;
|
||||
_serverChangeCount = changeCount;
|
||||
|
||||
// new server up..
|
||||
_context.lock()->newServerDetected();
|
||||
// new server up..
|
||||
_context.lock()->newServerDetected();
|
||||
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool networkChange = (memcmp(_serverGUID.value, guid.value, sizeof(guid.value)) != 0);
|
||||
if (networkChange)
|
||||
{
|
||||
// update startup time and change count
|
||||
_serverGUID = guid;
|
||||
_serverChangeCount = changeCount;
|
||||
bool networkChange = (memcmp(_serverGUID.value, guid.value, sizeof(guid.value)) != 0);
|
||||
if (networkChange)
|
||||
{
|
||||
// update startup time and change count
|
||||
_serverGUID = guid;
|
||||
_serverChangeCount = changeCount;
|
||||
|
||||
_context.lock()->newServerDetected();
|
||||
_context.lock()->newServerDetected();
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (_serverChangeCount != changeCount)
|
||||
{
|
||||
// update change count
|
||||
_serverChangeCount = changeCount;
|
||||
return true;
|
||||
}
|
||||
else if (_serverChangeCount != changeCount)
|
||||
{
|
||||
// update change count
|
||||
_serverChangeCount = changeCount;
|
||||
|
||||
// TODO be more specific (possible optimizations)
|
||||
_context.lock()->newServerDetected();
|
||||
_context.lock()->newServerDetected();
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
void BeaconHandler::changedTransport()
|
||||
{
|
||||
auto_ptr<TransportRegistry::transportVector_t> transports =
|
||||
_context.lock()->getTransportRegistry()->get(_protocol, &_responseFrom);
|
||||
if (!transports.get())
|
||||
return;
|
||||
|
||||
// notify all
|
||||
for (TransportRegistry::transportVector_t::iterator iter = transports->begin();
|
||||
iter != transports->end();
|
||||
iter++)
|
||||
{
|
||||
(*iter)->changedTransport();
|
||||
}
|
||||
if (!transports.get())
|
||||
return;
|
||||
|
||||
// notify all
|
||||
for (TransportRegistry::transportVector_t::iterator iter = transports->begin();
|
||||
iter != transports->end();
|
||||
iter++)
|
||||
{
|
||||
(*iter)->changedTransport();
|
||||
}
|
||||
}
|
||||
|
||||
}}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user