Added simple TCP socket server to handle requests and TCP socket client to test and measure.

This commit is contained in:
ftc
2023-02-14 22:48:18 +03:00
commit 09457cb6be
9 changed files with 535 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
#include "task.h"
#include <cstring>
#include <sstream>
using namespace std;
int cnt[256];
string Task(const string &message)
{
memset(cnt, 0, sizeof(cnt));
for (int i = 0; i < (int)message.length(); i++)
{
cnt[(int)(unsigned char)message[i]]++;
}
ostringstream result;
for (int i = 0; i < 256; i++)
{
if (cnt[i] == 0) continue;
result << i << ":" << cnt[i] << ";";
}
return result.str();
}