Giter Club home page Giter Club logo

Comments (4)

fpagliughi avatar fpagliughi commented on June 1, 2024

I totally agree with Go's rationale... If you're writing networking RPC code, you probably want NO_DELAY as the default.

Interestingly, I have a PR up on the Eclipse Paho MQTT C library to set NO_DELAY on the MQTT socket because I am using it a lot these days to write RPC-driven microservices over MQTT. And I really want to reduce the latency.

But if you're not coding RPCs, and rather doing a lot of small writes to push data upstream, then NO_DELAY can significantly increase the network usage and degrade performance.

So, what are people using this library to do? I have no idea. None. We get so little feedback on how our open-source projects are used! Right?

So... with that in mind, the intent of this library is to have no surprises. This is meant to be as thin a C++ layer around the C socket library as possible. So, on that note, I would prefer to keep the defaults the same as the OS. So no default NO_DELAY.

But...

I do think it should be easier to get and set some of the common socket options without resorting to really low level set_option() calls. I intend to make a bunch of new functions on the base socket() class for things like this:

set_nonblocking()
set_nosigpipe()
set_only_v6()
set_reuse_address()
set_reuse_port()
...

And then it would be nice to add some of these calls to some of the example apps to remind people that they're available.

from sockpp.

e-dant avatar e-dant commented on June 1, 2024

We get so little feedback on how our open-source projects are used! Right?

Totally there with you

no surprises

Sounds great

I intend to make a bunch of new functions

I have to hope that they'll all be there. I know plenty of Rust libraries that just kind of skip the bulk of them for reasons I'm not keen to. (I'm aware this isn't Rust, just pointing out that it's incongruous and evidently a "thing" to do.)


Issue closable?

from sockpp.

e-dant avatar e-dant commented on June 1, 2024

Also, thanks for your work, and happy holidays if you're into them this time of year.

from sockpp.

fpagliughi avatar fpagliughi commented on June 1, 2024

I know plenty of Rust libraries that just kind of skip the bulk of them for reasons I'm not keen to.

Actually I just copy-pasted those function names from the Rust socket2 library! I only discovered it recently and used it to re-implement some of the internals of the Rust socketcan crate - since socket2 has raw sockets and the std library does not. When I saw the setter/getter functions for the options, I just though... yeah.

from sockpp.

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.