hungdluit / flowlib

Automatically exported from code.google.com/p/flowlib
0 stars 0 forks source link

Wrong speed calculation #36

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Download any file
2. Increase TcpConncetion.cs buffer to big value like 10000000000
3. Watch speed it show incorreclty.

What is the expected output? What do you see instead?
It should calculates correctly

What version of the product are you using? ~~(Do not write latest)~~
SVN r 489

On what operating system?
Windows 7 RC (7100)

Please provide any additional information below.
Speed shows incorreclty because Collector used wrong field if message is 
FlowLib.Containers.BinaryMessage

I think it should be fixed like here:
GeneralProtocolDataCollector.cs
change 
protected override void HandleReceived(IConMessage msg) 
body to
if (msg is FlowLib.Containers.BinaryMessage)
{
TotalBytesReceived += (msg as FlowLib.Containers.BinaryMessage).Length;
}
else TotalBytesReceived += msg.Bytes.Length;

Original issue reported on code.google.com by hackw...@gmail.com on 12 May 2009 at 9:14

GoogleCodeExporter commented 8 years ago
I think this issue is invalid if it can only be reproduced with a buffer this 
high.
I mean, it is around 9 GiB of buffer for every open connection...

Original comment by blomman84 on 17 May 2009 at 1:57

GoogleCodeExporter commented 8 years ago
Buffer size is not the reason of problem, I have never used this buffer it is 
only 
for example. I'm using 102400 buffer size. If socket receives less data than 
buffer 
size msg.Bytes.Length contains total buffer size, not real data arrived.

Original comment by hackw...@gmail.com on 18 May 2009 at 6:28

GoogleCodeExporter commented 8 years ago
SVN updated.
Is it fixed?

Original comment by blomman84 on 18 May 2009 at 6:35

GoogleCodeExporter commented 8 years ago
Issue fixed. Thank you very much.

Original comment by hackw...@gmail.com on 19 May 2009 at 1:05

GoogleCodeExporter commented 8 years ago

Original comment by blomman84 on 20 May 2009 at 9:03