ClearBox Server v1.2 Developer's Guide |
ISynchronizer::SynchronizeCalled by server periodically to synchronize extension's database of current sessions records with actual sessions list on the NAS. HRESULT Synchronize( [in] long nasIPAddr, [in] unsigned long syncSize, [in] USERADDRESS * usersList, [out] VARIANT_BOOL * continueMonitoring); Parameters
Return ValuesIf server extension returns error code, server will repeat its synchronization attempt after a definite time span elapses (configured by Server Manager in Synchronization fail retry interval property). Thread SafetyThis method is called in context of SYNC thread. (See Server Threads Model for details.) You should synchronize data which is shared with other threads. Memory ManagementMemory pointed by usersList is allocated and freed by server. Example CodeThis code checks if John's session is actually active using information (usersList) provided by synchronization module. If accounting records say wrong, extension records internally that Jonh's session has ended. STDMETHODIMP CTest::Synchronize(long nasIPAddr, unsigned long syncSize, USERADDRESS * usersList, VARIANT_BOOL * continueMonitoring ) { // Note that we don't check NAS address for simplicity *continueMonitoring=VARIANT_TRUE; bool johnFound=false; for (int i=0;i<syncSize;i++) if (wcscmp(usersList[i].userName,L"John")==0) { johnFound=true; break; } // If accounting record say that John's session is active if (IsUsersSessionStarted(L"John") && johnFound) ReleaseSessionInfo(L"John"); // IsUsersSessionStarted and ReleaseSessionInfo - some functions // defined by extension } See AlsoISynchronizer, Synchronization concepts, Synchronization process © 2001-2003 XPerience Technologies. www.xperiencetech.com |
Created by chm2web html help conversion utility. |