Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are sockets integrated into the C++ standard?

Tags:

c++

sockets

Have the new C++ standards implemented a common way of handling sockets? In 2010 I know the standarization of threading was implemented in vs2k10 (C++0x later C++11). C++14 is knocking on the door.

I would hate to come back to still dealing with Winsock and regular Linux sockets. Compared to more modern languages, such as C# or java, they were also harder to use.

like image 788
tiki Avatar asked Sep 07 '14 01:09

tiki


3 Answers

not in c++(20), yet...

But there has been movement in the last years. Technical specifications, Drafts, conference talks...

There‘s an article by Vinnie Falco ( developer of boost::beast and active c++ evangelist) on reddit

  • socket.h in gcc (experimental)
  • working draft
  • experimental included in libstdc++
  • 2019: Suggestion to the c++ committee to include it in c++2020
like image 81
juwens Avatar answered Nov 11 '22 12:11

juwens


The Networking TS expected to be part of C++17 standard is based on Boost.ASIO, so for now u might want to use Boost.ASIO

like image 22
Pabitra Avatar answered Nov 11 '22 14:11

Pabitra


Are sockets integrated into the c++ standard

No.

Sockets are a part of the Posix and Winsock standards, not the C or C++ standard.

NB 'Non-JIT languages' have nothing to do with it.

like image 21
user207421 Avatar answered Nov 11 '22 14:11

user207421