Share via

problem with GetStreamAsync

yc 21 Reputation points
2021-03-04T01:33:42.843+00:00

Hi, I am new with Visual Studio C#.

Now I'm creating a code using GetStreamAsync to subscribe high frequency data.

Here is the problem.

At server side, it sends data(say data "A", "B", "C", "D", "E") to a client.
At client side, it must receives data "A", "B", "C", "D," "E" in order.
However, according to output log, I see the data "A", "B", "C", "E", "D"
("D" and "E" are back and forth, it should not be..)

Point is, the data subscribed are created/received in minimal time(like 10~20m sec).

Is that causes the "back and forth"? is this a known problem in VC# http client?
Any response would be appreciated.

Developer technologies | C#
Developer technologies | C#

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.

0 comments No comments

Answer accepted by question author

cheong00 3,491 Reputation points Volunteer Moderator
2021-03-04T02:02:18.817+00:00

If you really send data in single HTTP stream, it should receive data in the same order (TCP is responsible for preserve order of data packet be transmitted)

If your data is sent in multiple requests, then you're responsible for adding some index or timestamp that helps you to rearrange data on remote client, as when whatever part in the route gets choked, it'll cause delay and possibly drop packet, then the TCP will tell the server to resend the data again, and naturally the new "resent data" will arrive later than other data sent in similar time.

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. yc 21 Reputation points
    2021-03-04T02:43:06.453+00:00

    Dear cheong00,

    Your answer was really make sense.

    As you pointed "If your data is sent in multiple requests", server side accepts multiple http stream requests from many clients,
    So I need to handle the received data at client side(that is the responsibility at client side, I understand).

    I was wondering because there was no data gap happened in "python" language with same way(http stream).

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.