GithubHelp home page GithubHelp logo

Timeouts about serial HOT 6 OPEN

tarm avatar tarm commented on August 21, 2024
Timeouts

from serial.

Comments (6)

rugginoso avatar rugginoso commented on August 21, 2024 1

@pascaldekloe if you wait a little (go 1.10 I guess) you will get this for free: https://go-review.googlesource.com/c/go/+/71770

from serial.

pascaldekloe avatar pascaldekloe commented on August 21, 2024

Unmaintained indeed. For now I made timeouts work with https://github.com/pascaldekloe/nbio.

from serial.

tarm avatar tarm commented on August 21, 2024

The package works for me and is feature complete for my needs, so I am not actively making changes to it. The package has and does transfer millions of bytes in production systems and I have an active interest in making sure it continues to do so.

From my perspective, it does what I need it to, but if other people have other needs, then pull requests that are well designed and work across all platforms will be accepted.

Read timeouts already exist in the package, but they are have a different API than net.Conn. Search for timeout in https://godoc.org/github.com/tarm/serial The documentation of timeouts could be better (part of the docs say that still need to be implemented). The low level serial timeouts work differently than socket based timeouts and work differently on different platforms, so I suspect implementing the net.Conn timeout API would either be very complicated or would be misleading to people.

from serial.

pascaldekloe avatar pascaldekloe commented on August 21, 2024

Now I see that the read timeout is per request. 🔔

“Implementations of Read are discouraged from returning a zero byte count with a nil error”
… and:
“Callers should treat a return of 0 and nil as indicating that nothing happened”
https://godoc.org/io#Reader

Therefore a dedicated error is required such as the following.
https://godoc.org/github.com/pascaldekloe/nbio#ErrNoData

Do you agree @tarm?

PS
Maybe the "works for me" and the pull request barrier should be in the README to prevent disappointment? ;-)

from serial.

pascaldekloe avatar pascaldekloe commented on August 21, 2024

Indeed, the proposed convention seems to be the way to go. However I'm still waiting on @tarm to respond, again…

from serial.

jonaz avatar jonaz commented on August 21, 2024

status on this one @tarm ?

from serial.

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.