Use of 100% CPU when disconnected after some time
This commit is contained in:
parent
93b606ba99
commit
c2c6472c6f
1 changed files with 10 additions and 0 deletions
|
|
@ -931,14 +931,24 @@ public class XITelnet {
|
||||||
byte[] rBuf = new byte[1024];
|
byte[] rBuf = new byte[1024];
|
||||||
int len = 0;
|
int len = 0;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
int bclinf = 0;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
while(!ivTerminate) {
|
while(!ivTerminate) {
|
||||||
try {
|
try {
|
||||||
len = ivIn.read(buf);
|
len = ivIn.read(buf);
|
||||||
|
if (len == -1) {
|
||||||
|
ivTerminate = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (InterruptedIOException iex) { //!!V 03/03/98
|
catch (InterruptedIOException iex) { //!!V 03/03/98
|
||||||
len = 0;
|
len = 0;
|
||||||
|
bclinf ++;
|
||||||
|
if (bclinf > 1200) {
|
||||||
|
ivTerminate = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// process all IAC commands
|
// process all IAC commands
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue