diff options
Diffstat (limited to 'src/madc.cpp')
-rw-r--r-- | src/madc.cpp | 12 |
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; |