Example #1
0
void DviSubscription::WriteChanges()
{
    if (iExpired) {
        // reads/writes of iExpired assumed not to require thread safety
        // ...if this later turns out wrong, DO NOT USE iLock to protect iExpired - it'll deadlock with TimeManager's lock
        Remove();
        return;
    }
    IPropertyWriter* writer = NULL;
    try {
        AutoMutex a(iLock); // claim lock here to fully serialise updates to a single subscriber
        writer = CreateWriter();
        if (writer != NULL) {
            writer->PropertyWriteEnd();
        }
    }
    catch(NetworkTimeout&) {
        // we may block a publisher for a relatively long time failing to connect
        // its reasonable to assume that later attempts are also likely to fail
        // ...so its better if we don't keep blocking and instead remove the subscription
        LOG2(kDvEvent, kError, "Timeout eventing update for %.*s\n", PBUF(iSid));
        Remove();
    }
    catch(NetworkError&) {}
    catch(HttpError&) {}
    catch(WriterError&) {}
    catch(ReaderError&) {}
    if (writer != NULL) {
        iWriterFactory.ReleaseWriter(writer);
    }
}
Example #2
0
void DviSubscription::WriteChanges()
{
    IPropertyWriter* writer = NULL;
    try {
        AutoMutex a(iLock); // claim lock here to fully serialise updates to a single subscriber
        writer = CreateWriter();
        if (writer != NULL) {
            writer->PropertyWriteEnd();
            delete writer;
        }
    }
    catch(NetworkTimeout&) {
        // we may block a publisher for a relatively long time failing to connect
        // its reasonable to assume that later attempts are also likely to fail
        // ...so its better if we don't keep blocking and instead remove the subscription
        Remove();
    }
    catch(NetworkError&) {}
    catch(HttpError&) {}
    catch(WriterError&) {}
    catch(ReaderError&) {}
}
Example #3
0
void PropertyBinary::Write(IPropertyWriter& aWriter)
{
    aWriter.PropertyWriteBinary(iParameter->Name(), iValue);
}
Example #4
0
void PropertyBool::Write(IPropertyWriter& aWriter)
{
    aWriter.PropertyWriteBool(iParameter->Name(), iValue);
}
Example #5
0
void PropertyUint::Write(IPropertyWriter& aWriter)
{
    aWriter.PropertyWriteUint(iParameter->Name(), iValue);
}
Example #6
0
void PropertyString::Write(IPropertyWriter& aWriter)
{
    aWriter.PropertyWriteString(iParameter->Name(), iValue);
}