while (running) {
// Loop if endpoint is paused
- while (paused) {
+ while (paused && running) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
}
}
+ if (!running) {
+ break;
+ }
try {
// Accept the next incoming connection from the server socket
long socket = Socket.accept(serverSock);
// Loop until we receive a shutdown command
while (running) {
// Loop if endpoint is paused
- while (paused) {
+ while (paused && running) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
}
}
+ if (!running) {
+ break;
+ }
if (keepAliveCount < 1 && addCount < 1) {
synchronized (this) {
- while (keepAliveCount < 1 && addCount < 1) {
+ while (keepAliveCount < 1 && addCount < 1 && running) {
// Reset maintain time.
maintainTime = 0;
try {
}
}
+ if (!running) {
+ break;
+ }
try {
// Add sockets which are waiting to the poller
if (addCount > 0) {
SendfileData data = addS.get(i);
Socket.destroy(data.socket);
}
+ addS.clear();
// Close all sockets still in the poller
int rv = Poll.pollset(sendfilePollset, desc);
if (rv > 0) {
while (running) {
// Loop if endpoint is paused
- while (paused) {
+ while (paused && running) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
}
}
+ if (!running) {
+ break;
+ }
if (sendfileCount < 1 && addCount < 1) {
synchronized (this) {
- while (sendfileCount < 1 && addS.size() < 1) {
+ while (sendfileCount < 1 && addS.size() < 1 && running) {
// Reset maintain time.
maintainTime = 0;
try {
}
}
+ if (!running) {
+ break;
+ }
try {
// Add socket to the poller
if (addCount > 0) {