Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: TTimer on ServerMethodsUnit Datasnap Server


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Jun 24, 2016 4:41 AM Last Post By: Kim Madsen Threads: [ Previous | Next ]
Carlos Matos

Posts: 114
Registered: 6/25/01
TTimer on ServerMethodsUnit Datasnap Server  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 23, 2016 9:58 AM
I need to use Timers to check some states.
I dropped a Timer on ServerMethodsUnit unit but when I enabled this Timer, the OnTimer do not fire.
Can I use Timers on ServerDatamodules? If not, how can I overcome this issue?
Kim Madsen

Posts: 362
Registered: 12/13/99
Re: TTimer on ServerMethodsUnit Datasnap Server  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 24, 2016 4:41 AM   in response to: Carlos Matos in response to: Carlos Matos
Den 6/23/2016 kl. 18:58 skrev Carlos Matos:
I need to use Timers to check some states.
I dropped a Timer on ServerMethodsUnit unit but when I enabled this Timer, the OnTimer do not fire.
Can I use Timers on ServerDatamodules? If not, how can I overcome this issue?

Hi,

TTimer require a Windows message loop is running in your thread to make
a TTimer work.

On a server setup, you will want to use a thread of your own, and for
example sleep.

Alternatively you could use TkbmMWScheduler which is bundled with kbmMW
Pro/Ent (but I suppose that is a bit over the top if you only need a
simple TTimer replacement).

Its used like this:

kbmMWScheduler.Schedule(OnScheduledEvent).NamedAs(‘5secevent’).EverySecond(5).Activate(true);

EveryMSecond(n) – Schedules for every n milliseconds (1/1000 second)
EveryMinute(n) – Schedules for every n minutes
EveryHour(n) – Schedules for every n hours
EveryDay(n) – Schedules for every n days
EveryMonth(n) – Schedules for every n months
EveryYear(n) – Schedules for every n years

best regards
Kim/C4D

http://www.components4developers.com

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02