.
This commit is contained in:
15
main.cpp
15
main.cpp
@@ -1,5 +1,6 @@
|
||||
#include "Connection.h"
|
||||
#include "Payload.h"
|
||||
#include <thread>
|
||||
#include <iostream>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
@@ -10,13 +11,19 @@ int main(int argc, char *argv[])
|
||||
}else{
|
||||
c = new Connection(argv[1], atoi(argv[2]));
|
||||
}
|
||||
Payload p;
|
||||
p.push_char(0xFE);
|
||||
p.push_char(0x01);
|
||||
p.push_char(0xFA);
|
||||
if(c->status() != 0){
|
||||
return 1;
|
||||
}
|
||||
std::vector<unsigned char> p_data{0xFE, 0x01, 0xFA, 0x00, 0x08, 0x00, 0x4D, 0x00, 0x43, 0x00, 0x7C, 0x00, 0x50, 0x00, 0x69, 0x00, 0x6E, 0x00, 0x67, 0x00, 0x48, 0x00, 0x6F, 0x00, 0x73, 0x00, 0x74};
|
||||
Payload p(p_data);
|
||||
|
||||
c->send(p, true);
|
||||
Payload response = c->recv();
|
||||
std::cout << response.getData() << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void test_server(std::string addr, int port, Payload p){
|
||||
Connection c(addr, port);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user