You might wonder how web servers "serve" files, and how they deliver files that piece together a website that shows on your screen. Well, knowing h...
For further actions, you may consider blocking this person and/or reporting abuse
That's not C++, that's C, it doesn't even compile with a C++ compiler (in the Github project it uses gcc instead of g++)
To make it a valid C++ code you just to change some implicit conversion, like for exemple when you use malloc :
int* fd = malloc(sizeof(int));
In C++ you need to explicitly cast it:
int* toto = static_cast<int*>(malloc(sizeof(int)));
To make it more idiomatic C++ you would need to:
Thanks for the correction. I have no idea why I said C++ while I was using gcc - I was confusing it with another project I'm working on.
Don't worry it happens to everyone sometimes haha
I saw that you updated the title, don't forget to update the tag :)
WHY the heck do we need theese far-fetched idioms and features just to make a simple action and write minimalistic code?
Far fetched? You can see them for example in the core guidelines and a lot of codebase using modern c++ recommend to use similar idioms.
These idioms are not here just because someone said so, but because they make the code safer and more maintainable.
Also, I never said they had to apply them, but the code would almost the same structure and without same it was C code, not C++. Turns out that the author meant C and not C++ and he corrected the article.
Thank you for your efforts in writing this post. I just have one suggestion though. Instead of converting the code to images and then posting them. you can wrap your code in code fences. i.e put you between three backticks(`) followed by the name of the language, and end it with three more backticks
This allows the code to be copied directly from the post.
Other than that I liked your post.
Thank You.
Hey Adwaith, thanks for the suggestion! I tried using code blocks but the long code blocks would make the post unreadable, and the syntax highlighting in pictures make code easier to read
I understand. Thanks for the post.. It was helpful.
i would use epoll_wait and non blocking sockets
Good suggestion :)
I need full code can you please send me
github.com/JeffreytheCoder/Simple-...
Isn't the code slow because it's synchronous?