Title: Server : DataProvider - Function Post by: nmgoza on March 11, 2010, 06:39:19 AM Hi All
I am abit of a newbie, excuse my ignorance if question is not worthy :) 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. Title: Re: Server : DataProvider - Function Post by: D.Tkalcec (RTC) 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 Title: Re: Server : DataProvider - Function Post by: nmgoza on March 11, 2010, 04:46:24 PM Brilliant - and many many thanks - that makes it quite clear indeed. You are brilliant Danijel. :)
|