Code Monkey home page Code Monkey logo

Comments (2)

binki avatar binki commented on July 27, 2024

For example, it signals that the connection was reset and that the handle needs to be cleaned up. Code written against streams will expect this behavior to mean that the end of file was reached and it will assume that the bytes read so far represents the entirety of the entity being read.

Here I am meaning to say that when the API returns 0, normal Stream-using code will assume that meant a successful read of the entire entity. Whereas this “safe” wrapper is basically silently truncating the read data.

from sharpfilesystem.

FrozenCow avatar FrozenCow commented on July 27, 2024

Yes, totally agree. They were already in the IO directory, so it would be logical to namespace them in SharpFileSystem.IO. I think they could be useful in other projects as well. They are also simple enough to keep supporting them. So I think SharpFileSystem.IO instead of SharpFileSystem.Internal.IO is in order.

SafeNetworkStream was used to normalize Socket-based streams in some hacky applications in the past. For networking read 0 can often be handled the same way as IOException (socket was closed). I agree it is dirty. It also isn't in use by any of SharpFileSystem, so I removed it.

from sharpfilesystem.

Related Issues (16)

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.