From c97168bd5113fe726de42a4249df58c679e42240 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 25 Jun 2008 02:02:21 +0200 Subject: Neuen Receive-Stack implementiert --- src/mad-core.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/mad-core.cpp') 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 + +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; -- cgit v1.2.3