Good day. There was a need to create a socket. I was looking for a normal example on the Internet with comments, but I could not find a normal one (maybe my hands are curved) ...
I would be grateful for an example with comments. thank
If you don’t have anything against boost, then many examples on boost :: asio - http://www.boost.org/doc/libs/1_52_0/doc/html/boost_asio/examples.html
Creating a socket is just calling
socket with the correct parameters. They are different. At one time, this mega-state greatly helped me (there are in different languages, in html / pdf)
I was helped in due time by article with the unrolled example of the server and the client corresponding to it: Running the Winsock Client and Server Code Sample (Windows)
ps: in the current state of
MSDN , look for old articles more and more difficult
I once studied for this article: http://www.rsdn.ru/article/unix/sockets.xml
In general, searching for "programming sockets" can help much more.