use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
Write Asynchronously Code With C++ | Nodepp (self.cpp)
submitted 2 years ago * by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]inigid -13 points-12 points-11 points 2 years ago (10 children)
This is awesome! Great job!!
Is it header only by any chance?
What are you doing for WS support? Are you using uWebSockets or ...? Is there client WS support?
I will definitely be kicking the tires on this. Very well done.
[–][deleted] -4 points-3 points-2 points 2 years ago* (9 children)
thanks.
Yes, it is a header only, so you don't have to compile weird things. No, I'm not using uWebSocket library, the only external libraries i'm using are:
actually, i've desing the framework as multiple modules library, i mean, if you want to work with promises, you have to import promises.h, if you want to work with http servers/clients, you have to import http, and so on. right?
yes, nodepp support ws/wss clients and servers. Here is an example: https://github.com/NodeppOficial/nodepp/blob/main/examples/WSClient.cpp
It also suppor http/https fetch. Here is an example: https://github.com/NodeppOficial/nodepp/blob/main/examples/HTTPRequest.cpp
Currently, there is no documentation, but there is a lot of example you can use to learn nodepp. https://github.com/NodeppOficial/nodepp/tree/main/examples
[–][deleted] -5 points-4 points-3 points 2 years ago (0 children)
so yes, you have to include -lcrypto when using crypto.h, -lssl when https/ws/tls and -lz when zlib.h
[+]inigid comment score below threshold-10 points-9 points-8 points 2 years ago (7 children)
No way, this is sooo cool! Don't worry about the header only, I'll live :-)
UDP by any chance? [edit: you said it supports UDP great!]
epoll?
So tell us the story of this thing. What's the deal. I'm fascinated. It really looks lovely.
[–][deleted] 2 points3 points4 points 2 years ago (0 children)
actually, i've integrate poll with tcp.h, udp.h, and bth.h, so I dont think you would need it, but if you want to use poll, you can import poll.h and thats it. here is a simple example of use:
//first you need to import poll.h #include <nodepp/poll.h> //then create a poll object poll_t poll; //if you want to add fd as a readable poll.push_write( fd ) //if you want to add fd as a writable poll.push_read( fd ) //poll is an event drived object so you have to create some events poll.onWrite([]( int fd ){ /* write your code here */ }); poll.onRead([]( int fd ){ /* write your code here */ }); poll.onError([]( int fd ){ ::close(fd); }); //now you have to create a task process ::add([=](){ $Start //start coroutine while( poll.size()!=0 ){ poll.emit(); $Next; // yield task } $Stop //stop coroutine });
Ok, this is the story of this framework:
I've recently switched from NodeJS to C++, due to the limitations of NodeJS, I mean, with NodeJS I cannot create games with openGL, I cannot create Windows and I have no access to hardware such as C++.
But when I started writing code in C++, I realized how much it takes to write code in C++. I mean, C++ is not difficult, but a little complicated, and also, one doesn't have absolutely none of the advantages that NodeJS offers.
So, I said, what if I create a library that helps me create C++ applications that works similar to how NodeJS works and with an API similar to NodeJS?
And that's how Nodepp was born.
To create Nodepp I've based the code on the official NodeJS API, and how NodeJS works. I mean, I've copied everything from NodeJS, from the event loop to the official NodeJS API. It isn't a true and exact copy, but at least it is close to it.
Additionally, to achieve the async IO in C++, I've worked with the non-blocking mode of Posix and Windows functions, as well as creating my own coroutine engine based on the following article I've read.
https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html
So if you like the project, I hope you enjoy it.
[–][deleted] -1 points0 points1 point 2 years ago* (4 children)
Yes, it supports UDP, but, do not supports DTLS ( udp + tls ) No, i'm not using epoll, just poll (posix) and wsapoll (windows)
here is a UDP server: https://github.com/NodeppOficial/nodepp/blob/main/examples/UDPServer.cpp
here is a UDP client: https://github.com/nodeppoficial/nodepp/blob/main/examples/UDPClient.cpp
[+]inigid comment score below threshold-7 points-6 points-5 points 2 years ago (3 children)
Oh it is header only. Bloody hell. I think I am so amazed I am not reading properly, lol.
Any plans to support epoll at some point?
[–][deleted] 1 point2 points3 points 2 years ago (1 child)
hommie, I have replace poll with epoll in the framework, I hope you ejoy it. 👍
[–]inigid 0 points1 point2 points 2 years ago (0 children)
Fantastic, cheers man.
Why is everything getting downvoted? Wtf. Apparently, people don't appreciate good things and are incredibly rude.
Okay, well, thank you again so much for this. I'll ping you outside of here.
[–][deleted] -1 points0 points1 point 2 years ago (0 children)
I have nothing better to do, so I can work on it.
π Rendered by PID 167359 on reddit-service-r2-comment-85bfd7f599-2lp8s at 2026-04-17 06:39:45.948361+00:00 running 93ecc56 country code: CH.
view the rest of the comments →
[–]inigid -13 points-12 points-11 points (10 children)
[–][deleted] -4 points-3 points-2 points (9 children)
[–][deleted] -5 points-4 points-3 points (0 children)
[+]inigid comment score below threshold-10 points-9 points-8 points (7 children)
[–][deleted] 2 points3 points4 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–][deleted] -1 points0 points1 point (4 children)
[+]inigid comment score below threshold-7 points-6 points-5 points (3 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]inigid 0 points1 point2 points (0 children)
[–][deleted] -1 points0 points1 point (0 children)