Backward compatibility

This commit is contained in:
Trustin Lee 2009-09-04 07:19:32 +00:00
parent 8cf237f7f0
commit a436046692
2 changed files with 10 additions and 10 deletions

View File

@ -101,14 +101,14 @@ public class ReadTimeoutHandler extends SimpleChannelUpstreamHandler
if (unit == null) {
throw new NullPointerException("unit");
}
if (timeout <= 0) {
throw new IllegalArgumentException(
"timeout: " + timeout + " (expected: a positive integer)");
}
this.timer = timer;
if (timeout <= 0) {
timeoutMillis = 0;
} else {
timeoutMillis = Math.max(unit.toMillis(timeout), 1);
}
}
/**
* Stops the {@link Timer} which was specified in the constructor of this

View File

@ -97,14 +97,14 @@ public class WriteTimeoutHandler extends SimpleChannelDownstreamHandler
if (unit == null) {
throw new NullPointerException("unit");
}
if (timeout <= 0) {
throw new IllegalArgumentException(
"timeout: " + timeout + " (expected: a positive integer)");
}
this.timer = timer;
if (timeout <= 0) {
timeoutMillis = 0;
} else {
timeoutMillis = Math.max(unit.toMillis(timeout), 1);
}
}
/**
* Stops the {@link Timer} which was specified in the constructor of this