summaryrefslogtreecommitdiffstats
path: root/src/madc.cpp
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2008-06-27 19:34:09 +0200
committerMatthias Schiffer <matthias@gamezock.de>2008-06-27 19:34:09 +0200
commitd1306a1710cda4acb9a0138347cdb43943271b9c (patch)
tree50544a31e47670b257be804648c6d714750cee12 /src/madc.cpp
parentb143406a05a1698df5b88b0d4298362a9c8c080b (diff)
downloadmad-d1306a1710cda4acb9a0138347cdb43943271b9c.tar
mad-d1306a1710cda4acb9a0138347cdb43943271b9c.zip
Verbindungen geregelt trennen... hoffentlich...
Diffstat (limited to 'src/madc.cpp')
-rw-r--r--src/madc.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/madc.cpp b/src/madc.cpp
index aaf7197..08fb3b3 100644
--- a/src/madc.cpp
+++ b/src/madc.cpp
@@ -37,7 +37,8 @@ int main() {
connection.sendReceive(fd.revents);
}
- connection.send(Mad::Net::Packet(0x0001, 0xABCD));
+ connection.send(Mad::Net::Packet(Mad::Net::Packet::TYPE_DEBUG, 0x1234));
+ connection.send(Mad::Net::Packet(Mad::Net::Packet::TYPE_DISCONNECT_REQ, 0xABCD));
while(!connection.sendQueueEmpty()) {
struct pollfd fd = connection.getPollfd();
@@ -45,6 +46,15 @@ int main() {
if(poll(&fd, 1, 10000) > 0)
connection.sendReceive(fd.revents);
}
+
+ connection.disconnect();
+
+ while(connection.isConnected()) {
+ struct pollfd fd = connection.getPollfd();
+
+ if(poll(&fd, 1, 10000) > 0)
+ connection.sendReceive(fd.revents);
+ }
}
catch(Mad::Net::Exception &e) {
std::cerr << "Connection error: " << e.what() << std::endl;