It seems i put it on the server and i get infinity again !
onBWDone: kbitDown = Infinity, deltaDown= 25147, deltaTime = 0.0,
latency = 114KBytes 21
Dan Rossi wrote:
> It seems the damn thing works it was just a problem with the calbacks,
> any of the experts here know what methods i should use to pack AMF
> packet data properly to get near exact values out of this ?
>
> onBWDone: kbitDown = 2439332.3333333335, deltaDown= 7317997, deltaTime =
> 3.0, latency = 800KBytes 7143
>
>
> Here is the entire calculation we need to worry about, and then its
> done, we can set it up as a custom bean somehow ?
>
> public void resultReceived(IPendingServiceCall call) {
> long now = (new Date()).getTime()/1;
> this.pakRecv[this.count] = now;
> this.count++;
> int timePassed = (int)(now - this.beginningValues.get("time"));
>
> if (this.count == 1) {
>
> this.latency = Math.min(timePassed, 800);
>
> this.latency = Math.max(this.latency, 10);
>
> }
>
> //If we have a hi-speed network with low latency send more to
> determine
> // better bandwidth numbers, send no more than 6 packets
>
> if ( this.count == 2 && (timePassed<2000))
> {
>
> this.pakSent[this.sent++] = now;
> this.cumLatency++;
> this.callBWCheck(this.payload);
>
> //this.client.call("onBWCheck", res, this.client.payload);
> } else if (this.sent == this.count) {
> // See if we need to normalize latency
> if ( this.latency >= 100 )
> {
>
> // make sure we detect sattelite and modem correctly
> if (this.pakRecv[1] - this.pakRecv[0] > 1000)
> {
> this.latency = 100;
> }
>
> }
>
>
> this.payload = new double[0];
> //delete this.client.payload;
>
> // Got back responses for all the packets compute the bandwidth.
> this.getStats();
>
> long deltaDown = this.bytes_out -
> this.beginningValues.get("b_down")*8/1000;
> double deltaTime = ( (now -
> this.beginningValues.get("time")) - (this.latency*this.cumLatency))/1000;
>
> if (deltaTime <= 0) deltaTime = (now -
> this.beginningValues.get("time"))/1000;
> //System.out.println(deltaDown + " " + this.bytes_out + " "
> + this.beginningValues.get("b_down") + " " + deltaTime + " " + (now -
> this.beginningValues.get("time")) + " " + (this.latency*this.cumLatency));
>
> double kbitDown = deltaDown/deltaTime;
>
> System.out.println("onBWDone: kbitDown = " + kbitDown + ",
> deltaDown= " + deltaDown + ", deltaTime = " + deltaTime + ", latency = "
> + this.latency + "KBytes " + (this.bytes_out -
> this.beginningValues.get("b_down"))/1024);
>
> this.callBWDone(kbitDown, deltaDown, deltaTime, this.latency);
> }
>
> }
>
>
>
> Dan Rossi wrote:
>
>> sorry
>>
>> this.nc.client = this;
>>
>> it should pickup the callback methods in the current class.
>>
>> For some really odd reason im geting callback failed but the methods are
>> there, thats in both AMF0 and AMF3.
>>
>>
>> Saifur Rahman wrote:
>>
>>
>>> Dear Rossi,
>>>
>>> Do I have to do anything like the following to make the method work?
>>>
>>> this.nc.onStatus = Delegate.create(this, this.ncOnStatus)
>>>
>>> Saifur
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Red5 mailing list
>>> [email protected]
>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>
>>>
>>>
>> _______________________________________________
>> Red5 mailing list
>> [email protected]
>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>
>>
>>
>
>
> _______________________________________________
> Red5 mailing list
> [email protected]
> http://osflash.org/mailman/listinfo/red5_osflash.org
>
>
_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org