Giter Site home page Giter Site logo

simple-named-pipes-ipc's People

Contributors

dependabot[bot] avatar pirocks avatar

Stargazers

 avatar

Watchers

 avatar  avatar

simple-named-pipes-ipc's Issues

Negation for contentType needs another approach

Thanks for writing this, I used it and found a bug.

When passing through an IntArray, on reading, it couldn't figure out the type from

contentsType.and(0x7f)

I couldn't think of a better shorthand so I just changed it to

val absolute = if(contentsType < 0) (-contentsType).toByte() else contentsType

Then used that. I'm sure you can think of something better. It seems to matter if it's a Byte or an Integer.

Finalize gets called when it shouldn't

This was a tricky one.

In the method openPipes(), it creates NamedPipes. If it throws because they already exist, it replaces the created ones with a different set of NamedPipe.

The problem is, the original NamedPipe had been created with a reference to an existing file. When the reference is broken, that instance is sometimes garbage collected. This calls finalize() on NamedPipe, which then calls close(), which then deletes the file. But that file, by definition, is currently being used by some other client.

The visible symptom was that the NamedPipe doing the reading (not the one that just got deleted) hangs when it's lazy loading its DataInputSteam. That's because the file it's referencing is gone, and is never written to.

It only happened sometimes. Weirdly, when I wrote my own tests, they would hang if I ran one of the tests by itself, but worked fine when I ran more than one test. Dunno why.

The solution is instead of using try catch in openPipes(), check for the two files' existence before deciding what to create.

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.