Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 300 Vote(s) - 3.47 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Streaming responses

#1
So this is gonna be another one of my late night threads, and not really a tutorial, be warned.

Have you ever had to deliver a HUGE list of JSON objects, and hate the latency? Well this is your solution. Here's a bit of code:

Hidden Content
You must

[To see links please register here]

or

[To see links please register here]

to view this content.


Ok, why did I just give you all that code? Well, the answer is HTTP/2. There's no reason you can't async stream your responses with .net5, and that's required to do it. Here's a real world example:


Hidden Content
You must

[To see links please register here]

or

[To see links please register here]

to view this content.


Is the exception BS really necessary? no. but its in my code.
Alright, so what does this do?
well, on its own, nothing. However, if you understand IAsyncEnumerable and its applications in your code, you will be delighted to know that this is the network equivalent. However, on its own, it's useless. HttpClient will buffer the data and receive it as normal. But lets say you want that stream to be available as an async enumerable or equivalent? Well, here's my client code:


Hidden Content
You must

[To see links please register here]

or

[To see links please register here]

to view this content.


And....this is (for now) presented without comment. Enjoy.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through