Skip to main content
Participant
January 28, 2008
Question

checkBandwidth callback functions

  • January 28, 2008
  • 2 replies
  • 1000 views
Hi,
I just start with server-side embedded checkBandwidth function. I wonder is there any description of arguments and return values of onBWCheck and onBWDone. Seems like onBWCheck return something, but does it matter what it returns? I wonder why there is no documentation published, since this is built-in future.
Also not clear what onBWDone arguments are. It has four arguments. With analogue with 'Script-based bandwidth detection' it return download bandwidth, but what about upload bvandwidth? van it also be detected?

Thanks
    This topic has been closed for replies.

    2 replies

    Graeme Bull
    Community Expert
    Community Expert
    October 3, 2008
    Inspiring
    October 3, 2008
    Thanks! That tutorial looks like exactly what the doctor ordered! Much appreciated!
    Participating Frequently
    January 28, 2008
    The docs should describe this (I think). In any case, onBWCheck takes an arg, some random data that the server sends the client used to measure the available bw. You simply need to return a value, doesn't matter what, as an indication to the server that the client has received the data. onBWCheck may be called multiple times.

    onBWDone is called when the server is done measuring the bw and is passed the bw in Kbits/sec in the first argument. The 2nd and 3rd arguments are unused (to maintain compatibility with an older version of script based bw detection), and the 4th arg is latency in msec.

    Upload bw is not supported by native bw detection. But you could take the script based and just do the same thing, but in the opposite direction.
    January 28, 2008
    It looks like this didn't make it into the docs - not sure how that happened, but I've filed a bug.

    Apologies and thanks!
    Jody