()
| 194 | } |
| 195 | |
| 196 | public synchronized void run() { |
| 197 | while(true) { |
| 198 | if (s == null) { |
| 199 | /* nothing to do */ |
| 200 | try { |
| 201 | wait(); |
| 202 | } catch (InterruptedException e) { |
| 203 | /* should not happen */ |
| 204 | continue; |
| 205 | } |
| 206 | } |
| 207 | try { |
| 208 | handleClient(); |
| 209 | } catch (Exception e) { |
| 210 | e.printStackTrace(); |
| 211 | } |
| 212 | /* go back in wait queue if there's fewer |
| 213 | * than numHandler connections. |
| 214 | */ |
| 215 | s = null; |
| 216 | Vector pool = WebServer.threads; |
| 217 | synchronized (pool) { |
| 218 | if (pool.size() >= WebServer.workers) { |
| 219 | /* too many threads, exit this one */ |
| 220 | return; |
| 221 | } else { |
| 222 | pool.addElement(this); |
| 223 | } |
| 224 | } |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | |
| 229 | void handleClient() throws IOException { |
nothing calls this directly
no test coverage detected