RTC Forums
November 24, 2024, 07:26:26 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Server : DataProvider - Function  (Read 4926 times)
nmgoza
Guest
« on: March 11, 2010, 06:39:19 AM »

Hi All

I am abit of a newbie, excuse my ignorance if question is not worthy  Smiley
My Client Application calls a Server function via the ClientModule.Data.newFunction() method and the Call() method.
I would like to find out why the Server does not execute the function if one 'Accept's the Request in OnCheckRequest. If I do not code the OnCheckRequest, the function call gets Executed.
Another side question, what would be the difference between DataProvider.OnDataReceived Event and HTTPServer.OnDataIn Events.

Thanks alot.
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: March 11, 2010, 10:03:47 AM »

TRtcClientModule on the client side works with a TRtcServerModule on the Server side with a matching ModuleFileName property the same way like TRtcDataRequest on the client side will work with a TRtcDataProvider on the Server side with a matching Request.FileName property.

Using the "CheckOrder" property, which is available on TRtcServerModule and TRtcDataProvider components, you can define in which order OnCheckRequest events will be called on the components. The first component to "Accept" a request will bind the request to itself, so that it can safely process that request and send out a response without other components interfering.

So ... if you use a TRtcDataProvider component with a higher "CheckOrder" than your TRtcServerModule component, or even with the same CheckOrder but linked to the same TRtcHttpServer/TRtcDataServerLink component so that (by mere chance) its own "OnCheckRequest" event will get executed before it gets to the TRtcServerModule component, and you Accept a request in your TRtcDataProvider's OnCheckRequest event for a Request.FileName matching the ModuleFileName from your TRtcServerModule component, you will bind that request to your TRtcDataProvider, so it will NOT be processed by the TRtcServerModule. And that's exactly what is happening in your case.

If you want to use a TRtcDataProvider component for processing all requests which are NOT accepted by other TRtcDataProvider or TRtcServerModule components, you should set your TRtcDataProvider's CheckOrder property accordingly. A smaller CheckOrder value means a higher check order/priority. For a TRtcDataProvider to accept only requests which would be left un-accepted after all the other components OnCheckRequest events have had a chance to execute, its CheckOrder value has to be big (for example, your DataProvider1.CheckOrder should be at least 2 if your ServerModule1.CheckOrder is 1 or smaller).

Best Regards,
Danijel Tkalcec
Logged
nmgoza
Guest
« Reply #2 on: March 11, 2010, 04:46:24 PM »

Brilliant - and many many thanks - that makes it quite clear indeed. You are brilliant Danijel. Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.022 seconds with 16 queries.