RTC Forums
November 24, 2024, 05:24:39 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Help
Login
Register
RTC Forums
>
Subscription
>
Support
>
Get request and response sizes without using content buffering
Pages: [
1
]
« previous
next »
Print
Author
Topic: Get request and response sizes without using content buffering (Read 4357 times)
GeirBerg
RTC License+
Posts: 13
Get request and response sizes without using content buffering
«
on:
June 25, 2015, 10:02:36 AM »
Hi!
Is it possible to get the request and response sizes (content length) from a DataRouter without having to set ManualRead to false (using buffering)?
It does not matter when the information becomes available (before/during/after the request) as it is only used for logging and statistics.
If this is NOT possible, in general what impact on performance, delay, server resources, etc. can we expect from leaving ManualRead set to false?
Most calls will have quite small amounts of data in both directions (1-2 KB?), however a small percentage of the calls will have data in the order of multiple megabytes.
Unfortunately we cannot simply *test and measure* this scenario as the production servers can potentially have hundreds of simultanious users.
Regards.
Logged
D.Tkalcec (RTC)
Administrator
Posts: 1881
Re: Get request and response sizes without using content buffering
«
Reply #1 on:
June 25, 2015, 10:45:15 AM »
You have access to the complete Request and Response headers currently available to the DataRouter component (including the ContentLength value, when receiving content body) in all DataRouter events throught the Sender parameter (using Request and Response properties).
All events with the Sender parameter as
TRtcDataServer
give you access to the complete
Request
headers received from the Clients, while events with the Sender parameter as
TRtcDataClient
give you access to the complete
Response
headers received from the Server, even before a single byte of the content body was recevied, so there is no need for content buffering if you are only interested in Request and Response header information (like the ContentLength value, for example). You would only need to enable content buffering if you had to modify the content body before it is being forwarded to the other side, because the ContentLength value is defined in the HTTP header (Request and Response), so it has to be set before sending the actual content.
Best Regards,
Danijel Tkalcec
Logged
GeirBerg
RTC License+
Posts: 13
Re: Get request and response sizes without using content buffering
«
Reply #2 on:
June 25, 2015, 11:47:54 AM »
Thank you very much!
It works just fine now. I somehow managed to confuse myself with the details of how TRtcRouterContentBody and related events works. Simply checking the 'Content-Length' header didn't occur to me. Time for a coffee break, I think.
Regards.
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Dashboard
-----------------------------
=> General
=> 3rd-Party
=> Quick Start
-----------------------------
Subscription
-----------------------------
=> Support
Loading...