RTC Forums
November 24, 2024, 02:54:41 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: 1 [2]
  Print  
Author Topic: Creating a proxy server (get from server)  (Read 11980 times)
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #15 on: July 12, 2013, 10:45:31 PM »

As a side note ... ReqClosing is a variable which whould normally only be set to TRUE when the Application is terminating. It is a singnal that all request processing should stop. That variable would not change its state before the Application is ready to terminate.

Best Regards,
Danijel Tkalcec
Logged
HalcyonLogic
Newbie
*
Posts: 45


« Reply #16 on: July 12, 2013, 11:57:42 PM »

Ok, I've been starring at the demos for 7 hours now. Can't help thinking that there must be an easier way to do what I am trying to do.

What I am trying to archive is what this PHP code does:
$my_result = file_get_contents('https://www.3rdparty.com.test.net/someweblibarry.dll?Prop1=value1&Prope2=value2');
parse_str($my_result, $arr);
$result['TEST'] = $arr['TEST'];

Am i crazy or your demo requires a lot of of code to replace these 3 lines?

I found a work around here: http://stackoverflow.com/questions/301546/whats-the-simplest-way-to-call-http-get-url-using-delphi
This simple routine allows me to make a call to the webservice in question (using WinInet) and get it's response (without having to do all the work/events described in your demo).

Richard

Logged
HalcyonLogic
Newbie
*
Posts: 45


« Reply #17 on: July 13, 2013, 12:38:58 AM »

The WinInet work around does the rick for me, however, I would have liked to stick to RTC stuff.

Someone suggested to me using some of the Indy nightmare crap (I am not a big fan of Indy, never been, I try to avoid it like the plague if I can).

By all means, if my original question was misunderstood and RTC has a more elequent way of doing this, I am all ears.

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


« Reply #18 on: July 13, 2013, 06:51:00 AM »

With a TRtcDataRouter component, you have two advantages:

1) There are no threads blocking while waiting for a response from the Server.

2) If you don't need to modify the content body of the Response received from the 3rd-party Server, there is no need to buffer the complete response on your Server before it goes out to the Client, which has the advantage that your Clients will receive the response sooner, and your Server will only use a few KB of RAM to handle responses of any size (no intermediate buffering).

But ... if your Server only needs to handle a few Clients sending requests, and the size of each Response received from the 3rd-party Server is guaranteed to be small, the implementations you have found will also do the trick.

Best Regards,
Danijel Tkalcec
Logged
Pages: 1 [2]
  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.024 seconds with 16 queries.