summaryrefslogtreecommitdiffstats
path: root/src/mad-core.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mad-core.cpp')
-rw-r--r--src/mad-core.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mad-core.cpp b/src/mad-core.cpp
index 0c1630b..219621f 100644
--- a/src/mad-core.cpp
+++ b/src/mad-core.cpp
@@ -21,11 +21,20 @@
#include "Net/IPAddress.h"
#include <iostream>
+void recieveHandler(const Mad::Net::Connection*, const Mad::Net::Packet &packet) {
+ std::cout << "Recieved packet:" << std::endl;
+ std::cout << " Type: " << packet.getType() << std::endl;
+ std::cout << " Request ID: " << packet.getRequestId() << std::endl;
+ std::cout << " Length: " << packet.getLength() << std::endl;
+}
+
int main() {
Mad::Net::Connection::init();
Mad::Net::ServerConnection connection;
+ connection.signalRecieve().connect(sigc::ptr_fun(recieveHandler));
+
connection.loadDHParams("dh.pem");
connection.listen(Mad::Net::IPAddress("0.0.0.0", 6666));