NetTalk Central

Author Topic: NT sync multi dll how to  (Read 4646 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1871
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
NT sync multi dll how to
« on: July 29, 2019, 03:13:21 PM »
Hi, Ive imported the ServerSync proc of the Desktop example to my data.dll
1- How to start it from the exe menu?
Obviously using
Code: [Select]
  if glo:SyncDesktop.ControllerThread
    post(Event:ntUnhide , , glo:SyncDesktop.ControllerThread)
  ELSE
    Start(ServerSync,25000)
  End 
 
I get errors...
Unknown identifier: GLO:SYNCDESKTOP
Field not found: CONTROLLERTHREAD
Moving it to the exe I dont have this errors but needs to add the files to sync to the exe.

2- How does the ServerSync proc knows which tables to sync?
As I see looking for a ServerTimeStampKey on each file.
How to I hide a file for sync? may be changing the option of the ServerTimeStamp field?

3- From the docs:
This procedure can be a background procedure in your application (ideal where a single user exists for the remote program)
>>>or as a separate program on the LAN.
Does this means if Im in a Lan an I have a backgroud Serversync proc then I must assert it runs in one only pc?
>>>The sync procedure can be triggered by a timer (every few minutes or so)
This is in the template, if I want to call the sync myself which value must I use? zero?
>>>or it could be triggered by NetRefresh so that it synchronizes after every write.
how to do this?

« Last Edit: July 29, 2019, 05:02:46 PM by michelis »
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: NT sync multi dll how to
« Reply #1 on: July 29, 2019, 09:58:11 PM »
Hi Alberto,

>> Unknown identifier: GLO:SYNCDESKTOP
>> Field not found: CONTROLLERTHREAD

check in the example to see how these are declared, then do the same in your data dll app.

>> 2- How does the ServerSync proc knows which tables to sync?

It automatically does all of them that qualify.

>> As I see looking for a ServerTimeStampKey on each file.

among other things...

>> How to I hide a file for sync?

Check the source code (right-click, source) to see where the queue is being constructed. Remove the files you want from that queue.

Cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1871
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: NT sync multi dll how to
« Reply #2 on: July 30, 2019, 04:28:16 AM »
Thaks Bruce

3- From the docs:
This procedure can be a background procedure in your application (ideal where a single user exists for the remote program)
>>>or as a separate program on the LAN.
Does this means if Im in a Lan an I have a backgroud Serversync proc then I must assert it runs in one only pc?

>>>The sync procedure can be triggered by a timer (every few minutes or so)
This is in the template, if I want to call the sync myself which value must I use? zero?
I mean if I will call the proc by code and I dont want it to sync every xxx secs.

>>>or it could be triggered by NetRefresh so that it synchronizes after every write.
how to do this?
how to use NetRefresh with sync?
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: NT sync multi dll how to
« Reply #3 on: July 30, 2019, 10:06:55 PM »
>> Does this means if Im in a Lan an I have a backgroud Serversync proc then I must assert it runs in one only pc?

no, it's welcome to run on multiple PC's.
it only "has" to run on 1, but extras should be no problem.

>>>The sync procedure can be triggered by a timer (every few minutes or so). This is in the template, if I want to call the sync myself which value must I use? zero?

If you plan to alter the way the sync works, then I suggest you spend some time really understanding how it works, and what the impact of your changes will be. By all means makes changes to the plan, but then don't come crying to me when it doesn't work well :) - Data replication is complicated and it's designed the way it is for a reason.

>> I mean if I will call the proc by code and I dont want it to sync every xxx secs.

Examine in the code, see what the timer is doing, and go from there.
Bear in mind that more infrequent updates will lead to bigger syncs, and obviously more data is "inaccurate" for longer periods of time.

>> or it could be triggered by NetRefresh so that it synchronizes after every write.
>> how to do this?
>> how to use NetRefresh with sync?

That's probably a topic for another day. But short answer is that NetRefresh sends an event to your program, you could use that event to trigger a sync.

cheers
Bruce