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