diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2008-06-12 22:08:16 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2008-06-12 22:08:16 +0200 |
commit | 09e0fc185219e9e625baf096a68a221be55e0284 (patch) | |
tree | ca9f6cb1d54de72b50879a0a86378bdaf29e36d0 /src/mad-core.cpp | |
parent | d2969d6f715949521e49a9b99c947ada86b1b49f (diff) | |
download | mad-09e0fc185219e9e625baf096a68a221be55e0284.tar mad-09e0fc185219e9e625baf096a68a221be55e0284.zip |
Signalisiere empfangende Pakete.
Diffstat (limited to 'src/mad-core.cpp')
-rw-r--r-- | src/mad-core.cpp | 9 |
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)); |