Git Product home page Git Product logo

Comments (5)

sinkingsugar avatar sinkingsugar commented on May 25, 2024

Hah, ok transport was in libp2p, my bad, moving this issue over!

from nim-chronos.

sinkingsugar avatar sinkingsugar commented on May 25, 2024

Nevermind, re-opening, it's using chronos stream.nim tcp transport

Curiously being a tcp stream there should be no issues with fragmentation :/ I suspect some buffer is too small, will look further myself later.

from nim-chronos.

sinkingsugar avatar sinkingsugar commented on May 25, 2024

Update: up to

var vector = StreamVector(kind: DataBuffer,

data is still all there, it's really on the reading side that gets lost it would seem.

Edit:
Well looking further I noticed that indeed there is no fragmentation and/or no setting of SO_SNDBUF, more over it would seem that the effective sent size is not checked either , so it might be send side indeed.. Investigating it now.

Edit2:
Hmm fragmentation seems handled here on sending:

let res = posix.send(fd, vector.buf, vector.buflen, MSG_NOSIGNAL)

from nim-chronos.

sinkingsugar avatar sinkingsugar commented on May 25, 2024

Bonus issue:

vector.writer.complete(vector.buflen)

Seems to complete with just the last fragment size

Side note to @dryajov : we don't check write actual sent sizes, we return Future[void] should prob return Future[size]

from nim-chronos.

sinkingsugar avatar sinkingsugar commented on May 25, 2024

Found the problem, again my fault related to some bad pattern (more about it vacp2p/nim-libp2p#75).
I was closing the sender side too soon, so recv would return 0 as in connection was closed.
No issue in chronos except the Bonus issue above.

from nim-chronos.

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.