diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2008-06-25 02:02:21 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2008-06-25 02:02:21 +0200 |
commit | c97168bd5113fe726de42a4249df58c679e42240 (patch) | |
tree | 9802e84fc817f190e4595ac78c3f3f81f1a8d890 /src/mad-core.cpp | |
parent | 6aedcd087462eb198958229f3c9785da6ac52cf3 (diff) | |
download | mad-c97168bd5113fe726de42a4249df58c679e42240.tar mad-c97168bd5113fe726de42a4249df58c679e42240.zip |
Neuen Receive-Stack implementiert
Diffstat (limited to 'src/mad-core.cpp')
-rw-r--r-- | src/mad-core.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mad-core.cpp b/src/mad-core.cpp index 5ac0794..04b18cc 100644 --- a/src/mad-core.cpp +++ b/src/mad-core.cpp @@ -21,11 +21,16 @@ #include "Net/IPAddress.h" #include <iostream> + +bool running = true; + void receiveHandler(const Mad::Net::Connection*, const Mad::Net::Packet &packet) { std::cout << "Received 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; + + running = false; } int main() { @@ -37,7 +42,7 @@ int main() { try { connection.listen(Mad::Net::IPAddress("0.0.0.0", 6666)); - while(!connection.receive()); + while(running) connection.sendreceive(); } catch(Mad::Net::Exception &e) { std::cerr << "Connection error: " << e.what() << std::endl; |