Commit f1d0ae56 authored by Daniel Wolf's avatar Daniel Wolf

Use a timeout for the poll

parent 8a9f939e
......@@ -157,7 +157,7 @@ public class DNSTCPProxy extends DNSProxy{
pollingFd.fd = ParcelFileDescriptor.fromSocket(socket).getFileDescriptor();
pollingFd.events = (short)OsConstants.POLLIN;
}
poll(polls, -1);
poll(polls, 3000);
}
if(blockFd.revents != 0){
shouldRun = false;
......@@ -187,7 +187,7 @@ public class DNSTCPProxy extends DNSProxy{
}else {
pollTries++;
try{
Os.poll(polls, timeout);
Os.poll(polls, timeout/pollTries);
pollTries = 0;
} catch(ErrnoException ex){
if(pollTries < 3) poll(polls, timeout);
......
......@@ -148,7 +148,7 @@ public class DNSUDPProxy extends DNSProxy{
pollingFd.fd = ParcelFileDescriptor.fromDatagramSocket(socket).getFileDescriptor();
pollingFd.events = (short)OsConstants.POLLIN;
}
poll(polls, -1);
poll(polls, 3000);
}
if(blockFd.revents != 0){
shouldRun = false;
......@@ -178,7 +178,7 @@ public class DNSUDPProxy extends DNSProxy{
}else {
pollTries++;
try{
Os.poll(polls, timeout);
Os.poll(polls, timeout/pollTries);
pollTries = 0;
} catch(ErrnoException ex){
if(pollTries < 3) poll(polls, timeout);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment