From 09e0fc185219e9e625baf096a68a221be55e0284 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 12 Jun 2008 22:08:16 +0200 Subject: Signalisiere empfangende Pakete. --- src/mad-core.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/mad-core.cpp') 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 +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)); -- cgit v1.2.3