summaryrefslogtreecommitdiffstats
path: root/src/madc.cpp
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2008-06-27 12:48:28 +0200
committerMatthias Schiffer <matthias@gamezock.de>2008-06-27 12:48:28 +0200
commitb143406a05a1698df5b88b0d4298362a9c8c080b (patch)
treeeccf462dcc655073ae6833107fdecc8b5e22bf73 /src/madc.cpp
parent86c1806046dea0bf7c2525d0aa591cdae9b3d330 (diff)
downloadmad-b143406a05a1698df5b88b0d4298362a9c8c080b.tar
mad-b143406a05a1698df5b88b0d4298362a9c8c080b.zip
Korrekte Behandlung des Poll-Timeouts
Diffstat (limited to 'src/madc.cpp')
-rw-r--r--src/madc.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/madc.cpp b/src/madc.cpp
index 8104d0b..aaf7197 100644
--- a/src/madc.cpp
+++ b/src/madc.cpp
@@ -33,8 +33,8 @@ int main() {
while(connection.isConnecting()) {
struct pollfd fd = connection.getPollfd();
- poll(&fd, 1, 10000);
- connection.sendReceive(fd.revents);
+ if(poll(&fd, 1, 10000) > 0)
+ connection.sendReceive(fd.revents);
}
connection.send(Mad::Net::Packet(0x0001, 0xABCD));
@@ -42,8 +42,8 @@ int main() {
while(!connection.sendQueueEmpty()) {
struct pollfd fd = connection.getPollfd();
- poll(&fd, 1, 10000);
- connection.sendReceive(fd.revents);
+ if(poll(&fd, 1, 10000) > 0)
+ connection.sendReceive(fd.revents);
}
}
catch(Mad::Net::Exception &e) {