blob: d4890aa3384111a0e1251b0b6fc7ef46cc6eb94c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#include <cstdint>
#include <iostream>
#include <stdexcept>
#include <string>
#include "shared_memory_server.h"
int main(int argc, char* argv[])
{
if (argc != 2) {
std::cout << "One argument required" << '\n';
return 1;
}
uint32_t size;
try {
size = std::stoi(std::string(argv[1]));
} catch (const std::invalid_argument& e) {
std::cout << "Invalid argument" << '\n';
return 1;
}
SharedMemoryServer<int, int> shm(size);
shm.process_requests();
return 0;
}
|