Skip to main content
micpen
Participating Frequently
November 3, 2015
Question

Socket HTTP Request

  • November 3, 2015
  • 1 reply
  • 1658 views

Hi,

With a plugin from the SDK examples, can we do the same thing than the socket do in script. I mean send a http request for example every 30 seconds, without the operator have to click a button ?

This topic has been closed for replies.

1 reply

Community Expert
November 3, 2015

either create a separate thread that will do the call whenever you want,

and then call AEGP_CauseIdleRoutinesToBeCalled() from that thread. (the

only thread safe call in the SDK!)

or look into idle_hook, which is a periodic call (up to 40 times per

second) AE sends to all AEGPs who have registered.

Legend
November 30, 2015

either create a separate thread that will do the call whenever you want,

and then call AEGP_CauseIdleRoutinesToBeCalled() from that thread.

I think I can understand the suggestion regarding the idle_hook, but how does one go about "creating a separate thread"?  Doesn't all plugin code eventually get called from one of the selectors within the main switch?

Thanks,

Arie

November 30, 2015

I think what Shachar meant was simply creating your own thread (using C++11's own thread support, or a library like pthreads or boost).

This thread can for example be created/started in the GlobalSetup() function (for global threads) or in the SequenceSetup() function (for instance specific threads).