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); } }
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&) {} }
void PropertyBinary::Write(IPropertyWriter& aWriter) { aWriter.PropertyWriteBinary(iParameter->Name(), iValue); }
void PropertyBool::Write(IPropertyWriter& aWriter) { aWriter.PropertyWriteBool(iParameter->Name(), iValue); }
void PropertyUint::Write(IPropertyWriter& aWriter) { aWriter.PropertyWriteUint(iParameter->Name(), iValue); }
void PropertyString::Write(IPropertyWriter& aWriter) { aWriter.PropertyWriteString(iParameter->Name(), iValue); }