English 中文(简体)
计算连接率(比例)(相对)
原标题:Calculating connection rate (ms) (latency)
  • 时间:2012-05-05 00:07:33
  •  标签:
  • c#
  • tcp

I m 试图计算相关客户(服务器和客户)的相关性 我想在我的假借期间(在我检验客户是否仍然有关系时)这样做,就是我是如何在座的(如果客户不与客户脱节,就算发送数据)。

        while (information.connectionEst)
        {
            try
            {


                byte[] data = Encoding.ASCII.GetBytes("");

                stream.Write(data, 0, data.Length);


            }
            catch (Exception e)
            {

                killConnection();
                thread.Abort();
            }

        }

我假定,我需要计算发送成套数据所需的时间。 但我不敢肯定如何做到这一点。 任何帮助都将得到评估。

问题回答

It is very difficult to get the unidirectional latency (server→client) of a connection. You can do it if you know that you have very accurate time on each end of the connection (e.g. GPS or atomic clock or high quality NTP-synced clock very close to that) and software running on each side dedicated to the task.

否则,你所能做的最好办法是计算两个方向的相对值(RTT,往返时间),按2分,并希望连接是包装单的通道。 如果包装单的道路不是不对称的,那么包装单的行程要长得多,而且你无法事先知道会更长时间。

计算《公路货运公约》是三角的:一方发出短信息,另一方立即返回。 第一部分从发出请求信息以获取区域贸易协定之时起,就减去收到答复信息的时间。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签