Finding the simplest (and fastest) example of programming TCP sockets for windows, c, or C ++

I am looking for the simplest (and fastest) example of programming TCP sockets for Windows, c or C ++, depending on what can speed up its execution by sending trivial data, for example 1 byte or several bytes, but in one package, This is for research goals. I googled and found some examples, however each of them looks a little different, some of them in C, some of them in C ++, some use ZeroMemory (from windows), some use memset, some of them assign data according to differently, so while I can find winsock examples in c / C ++ and as long as I am not an expert in socket programming - I'm not sure if the c / C ++ code is absolutely minimalistic to achieve this in the fastest way.

I know that UDP will be much faster, but it must be reliable at the same time, so I'm looking for TCP.

I think I could try each one of them and try to find them, but it was interesting if some expert socket / winsock would have a super-simple server / client in C / C ++ with some synchronization function (high resolution) in in the end, I say super simple because I’m trying to determine how fast (and the fastest way) a socket can transfer to my machines, of course, it can include disabling the Nagle algorithm, and this is what I would like to do in any case. I'm not sure what other tricks people use.

Thank.

+3
source share
8 answers

Before writing the third comment, I collect them in response

0

Len Holgate . , , . . , , .

, , , .

+2

Boost Asio, , . , .

edit: , /, , Asio , , .

+2
+1

, . , :

:

  • OpenDDS - DDS ( - , , ..). , boost:: asio, , .
  • ZeroMQ - DDS, MQ ( /), MQ , ZeroMQ .
  • AMQP - , - Red Hat , .

:

  • Tibco RV: ,
  • 29West - ( - )
  • Solace -
  • Tervella -

, !;)

+1

, socket ++, . , asio, , , .

, , , std:: cout std:: cerr.

EDIT: , , XP, , , - win vista 7).

0

ucspi-tcp

Oldie, but goodie, written in C, qmail is a widely used mail server based on it.

https://cr.yp.to/ucspi-tcp.html

0
source

Source: https://habr.com/ru/post/1770548/


All Articles