Search Results

Search found 2 results on 1 pages for 'publicenemy'.

Page 1/1 | 1 

  • How to measure the time taken by C# NetworkStream.Read?

    - by publicENEMY
    I want to measure time taken for client to receive data over tcp using c#. Im using NetworkStream.Read to read 100 megabits of data that are sent using NetworkStream.Write. I set the buffer to the same size of data, so there no buffer underrun problem etc. Generally it looks like this. Stopwatch sw = new Stopwatch(); sw.Start(); stream.Read(bytes, 0, bytes.Length); sw.Stop(); The problem is, there is a possibility where the sender hasnt actually sent the data but the stopwatch is already running. how can i accurately measure the time taken to receive the data? i did try to use the time lapse of the remote pc stream.Write, but the time it took to write is extremely small. by the way, is the stopwatch is the most accurate tool for this task?

    Read the article

  • Measure data transfer rate over tcp using c#

    - by publicENEMY
    i want to measure current download speed. im sending huge file over tcp. how can i capture the transfer rate every second? if i use IPv4InterfaceStatistics or similar method, instead of capturing the file transfer rate, i capture the device transfer rate. the problem with capturing device transfer rate is that it captures all ongoing data through the network device instead of the single file that i transfer. how can i capture the file transfer rate? im using c#.

    Read the article

1