Code Monkey home page Code Monkey logo

Comments (4)

bwoebi avatar bwoebi commented on May 25, 2024

You test this by writing large chunks of data to a stream, in particular > 128 KiB (depends on internal buffer sizes, but 128 KiB turned our to always be enough).

E.g. you create a socket pair and write > 128 KB onto it without reading from it.

The code in case there's no full buffer is about reducing latency. Otherwise we have to wait until the next tick for sending the data. You will in particular notice that on servers with a high load.

from byte-stream.

 avatar commented on May 25, 2024

Thank you @bwoebi, I have done some tests, and get another question :)

example:

  1. client fwrite() 128 bytes of data to stream
  2. server don't fread() them

in this case client's fwrite() will succeed, and there are no way to detect if server fread() / stream_get_contents() them ?

P.S: I suppose that's why we always have server confirmations in classic client <-> server topology

from byte-stream.

bwoebi avatar bwoebi commented on May 25, 2024

Correct.
You still have to consider, even if you'd rely on a TCP confirmation, it still doesn't mean that a server actually processed something, it just means that the kernel (or if we move that to userspace: the application) has received it. But that doesn't contain any meaningful information for us: we want to know whether a client processed something. So, yes.

from byte-stream.

 avatar commented on May 25, 2024

@bwoebi Thank you, this was very informative, I think we can close this.

from byte-stream.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.