#include "mxnetwork/socket.hpp"
#include <atomic>
#include <cstdlib>
#include <iostream>
#include <mutex>
#include <poll.h>
#include <signal.h>
#include <string>
#include <thread>
#include <vector>
Go to the source code of this file.
|
| std::atomic< bool > | active {false} |
| std::mutex | mut |
◆ main()
| int main |
( |
int | argc, |
|
|
char ** | argv ) |
Definition at line 137 of file relay.cpp.
137 {
138
139 if (argc != 2) {
140 std::cout << "Use:\n"
141 << argv[0] << " <port>\n";
142 return EXIT_FAILURE;
143 }
144 try {
145
146 struct sigaction sa{};
148 if (sigaction(SIGINT, &sa, nullptr) == -1) {
149 perror("sigaction");
150 return EXIT_FAILURE;
151 }
152
155 return EXIT_SUCCESS;
157 std::cerr <<
"relay: Exception: " << e.
text() <<
"\n";
158 return EXIT_FAILURE;
159 }
160 return EXIT_SUCCESS;
161}
bool listen(std::string_view port)
Lightweight exception wrapper for MXNetwork failures.
std::string text() const
Return the stored error text.
◆ quit_signal()
Definition at line 133 of file relay.cpp.
133 {
135}
std::atomic< bool > active
◆ active
| std::atomic<bool> active {false} |
◆ mut