RTC Forums
November 25, 2024, 02:57:09 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
>
Calc Bandwidth For Each Connection
Pages: [
1
]
« previous
next »
Print
Author
Topic: Calc Bandwidth For Each Connection (Read 5277 times)
DonR
Newbie
Posts: 3
Calc Bandwidth For Each Connection
«
on:
May 28, 2010, 04:38:57 PM »
Hi Danijel,
Is there an easy way to measure bandwidth for each connection on a server during file uploads? I assume it can be calculated in the OnDataReceived event by saving the time each OnDataReceived is fired?
It would also be great to have a method to limit connection bandwidth. I would want to be able to determine the bandwidth of all current connections and then throttle back a few to avoid additional bandwidth charges from my data center.
Thanks
Logged
D.Tkalcec (RTC)
Administrator
Posts: 1881
Re: Calc Bandwidth For Each Connection
«
Reply #1 on:
May 28, 2010, 06:25:55 PM »
You should be able to use OnDataIn and OnDataOut events to calculate your currently used bandwidth.
As for bandwidth control, I'm afraid there is no elegant way (no properties you could set) to force downloads or uploads to slow down using the current stable RTC SDK release (2010 Q2), but you might be able to get it working by injecting Sleep() calls inside OnDataIn and/or OnDataOut events when you think too much bandwidth is being used.
Best Regards,
Danijel Tkalcec
Logged
Kevin Powick
RTC Expired
Posts: 87
Re: Calc Bandwidth For Each Connection
«
Reply #2 on:
May 31, 2010, 01:10:40 AM »
Not that I am in any need of it, but maybe bandwidth throttling could be a future enhancement? It might be a good property to have on both client and server components.
--
Kevin
Logged
Linux is only free if your time is worthless
D.Tkalcec (RTC)
Administrator
Posts: 1881
Re: Calc Bandwidth For Each Connection
«
Reply #3 on:
May 31, 2010, 08:51:18 AM »
If anyone needs to reduce bandwidth usage, the easiest way to implement sending and receiving speed reduction is to use Sleep inside OnDataIn and OnDataOut events. When writing my first reply (above), I through that using Sleep would be a bad idea because it will result in RTC threads being occupied while waiting (sleeping), but if you want to slow down sending and receiving through all connections, keeping threads occupied in a Sleep is actually a positive side-effect. And since OnDataIn and OnDataOut events are being called directly from the lowest API access layer in the RTC SDK (where the actual sending and receiving is being done), it gives you the same level of control as if you were extending the RTC SDK.
Best Regards,
Danijel Tkalcec
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Dashboard
-----------------------------
=> General
=> 3rd-Party
=> Quick Start
-----------------------------
Subscription
-----------------------------
=> Support
Loading...