Comments (4)
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.
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.
Also, thanks for your work, and happy holidays if you're into them this time of year.
from sockpp.
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)
- Can I clone a udp_socket HOT 3
- Error in cross-compiling for SH4 Linux HOT 3
- Win32 build issue with Unicode HOT 4
- Cannot use UDP sockets: unresolved external symbol HOT 3
- Moving toward stateless I/O without exceptions HOT 2
- Adding debug postfix
- Is there or will there be a way to join a multicast group? HOT 6
- Partial shutdown socket handle release.
- Fail to get data after second connect via Unix Domain Sockets
- Android compilation is broken with recent NDK (strerror_r) HOT 1
- Use std::span() HOT 13
- Non-blocking accept HOT 7
- CMake error with old CMake version HOT 4
- Build failed with -DSOCKPP_BUILD_TESTS=ON HOT 7
- uniform_int_distribution<char> does not compile with libc++ HOT 3
- Strange build failure on i386 HOT 5
- Examples are out of touch with reality and documentation HOT 4
- Broken example 'tcpecho' HOT 6
- SO_REUSEADDR HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sockpp.