summaryrefslogtreecommitdiffstats
path: root/src/mad-core.cpp
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2008-06-12 22:08:16 +0200
committerMatthias Schiffer <matthias@gamezock.de>2008-06-12 22:08:16 +0200
commit09e0fc185219e9e625baf096a68a221be55e0284 (patch)
treeca9f6cb1d54de72b50879a0a86378bdaf29e36d0 /src/mad-core.cpp
parentd2969d6f715949521e49a9b99c947ada86b1b49f (diff)
downloadmad-09e0fc185219e9e625baf096a68a221be55e0284.tar
mad-09e0fc185219e9e625baf096a68a221be55e0284.zip
Signalisiere empfangende Pakete.
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));