summaryrefslogtreecommitdiffstats
path: root/src/madc.cpp
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2008-06-27 04:08:33 +0200
committerMatthias Schiffer <matthias@gamezock.de>2008-06-27 04:08:33 +0200
commit86c1806046dea0bf7c2525d0aa591cdae9b3d330 (patch)
treeab3091e3f2201489383dc212a2b3b10f93dc5796 /src/madc.cpp
parentf5377412a89b2a7f422decd771dc8de49a5498fc (diff)
downloadmad-86c1806046dea0bf7c2525d0aa591cdae9b3d330.tar
mad-86c1806046dea0bf7c2525d0aa591cdae9b3d330.zip
Aufwendigere Verarbeitung des Pollings, jetzt auch im Test-Client
Diffstat (limited to 'src/madc.cpp')
-rw-r--r--src/madc.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/madc.cpp b/src/madc.cpp
index 762429e..8104d0b 100644
--- a/src/madc.cpp
+++ b/src/madc.cpp
@@ -30,13 +30,21 @@ int main() {
try {
connection.connect(Mad::Net::IPAddress("127.0.0.1", 6666));
- while(connection.isConnecting())
- connection.sendReceive();
+ while(connection.isConnecting()) {
+ struct pollfd fd = connection.getPollfd();
+
+ poll(&fd, 1, 10000);
+ connection.sendReceive(fd.revents);
+ }
connection.send(Mad::Net::Packet(0x0001, 0xABCD));
- while(!connection.sendQueueEmpty())
- connection.sendReceive();
+ while(!connection.sendQueueEmpty()) {
+ struct pollfd fd = connection.getPollfd();
+
+ poll(&fd, 1, 10000);
+ connection.sendReceive(fd.revents);
+ }
}
catch(Mad::Net::Exception &e) {
std::cerr << "Connection error: " << e.what() << std::endl;