generated from AfonsoCMSousa/CPP-Template
Refactor: Rewriting new functions and classes in C++ with better code readability in mind
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
@@ -6,12 +7,25 @@
|
||||
|
||||
#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;
|
||||
sock.connect(app.app_server_out_ip, app.app_port_out);
|
||||
|
||||
packet = sock.create_packet((uint8_t)app.app_id);
|
||||
sock.set_packet(packet);
|
||||
sock.send();
|
||||
} catch (const runtime_error &e) {
|
||||
cerr << "Error: " << e.what() << endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user