generated from AfonsoCMSousa/CPP-Template
36 lines
758 B
C++
36 lines
758 B
C++
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <iostream>
|
|
#include <stdexcept>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "file.hpp" // for parce_args
|
|
#include "net.hpp" // for socket operations
|
|
#include "server_structs.h"
|
|
|
|
using namespace std;
|
|
|
|
int main(int argc, char *argv[]) {
|
|
app_info app = parce_args(argc, argv);
|
|
api_packet packet;
|
|
|
|
try {
|
|
Socket sock;
|
|
// Connect to API socket path
|
|
sock.connect_unix(app.app_api_socket_path, app.app_port_out);
|
|
|
|
// Send a packet for test to API
|
|
packet = sock.create_packet(app.app_id); // tracker_id = 1
|
|
sock.send_unix(packet);
|
|
|
|
} catch (const runtime_error &e) {
|
|
cerr << "Error: " << e.what() << endl;
|
|
return 1;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
|