Is network programming in C++ hard? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Is network programming in C++ hard?

Hello guys, I'm currently an enthusiast in C++ and is more interested in network programming. Could anyone please show me where to begin and what I should know to begin?

7th Jan 2020, 6:34 AM
George Onyango
3 Answers
+ 2
Network programming is a little harder in c++ than in c#, Python, and Java because the network programming libraries aren't part of the c++ standard. Even the newer c++ standards such as c++ 11 don't include standardized networking functions. c++ is generally quite portable but the network programming libraries generally aren't so you have to rewrite a lot when building for Windows as apposed to Linux, Unix, or Mac. Aside from there being a few different non-standard libraries for network programming in c++, it isn't that hard to do. I used c++ to make an HTTP server and had to write sections using winsock with others using unix libraries. It was annoying in some ways but not too bad. Some new libraries would likely be better choices for HTTP now. To read more discussion on c++'s lack of standardization of network functionality, see https://stackoverflow.com/questions/27126126/why-is-there-a-networking-library-proposal-for-c14-17
7th Jan 2020, 5:43 PM
Josh Greig
Josh Greig - avatar
+ 2
Thanks for the heads up. Anyway I was working on a portscan project and want to do the socket programming part without relying on third party libraries like SFML.
8th Jan 2020, 8:21 AM
George Onyango
+ 1
Learning Linux Socket will be the best choice. But like Josh Greig said if you want portability you have to rely of 3rd party library.
9th Jan 2020, 6:41 AM
Utkarsha Khanal
Utkarsha Khanal - avatar