MCPcopy Index your code
hub / github.com/processing/processing / run

Method run

java/libraries/net/src/processing/net/Server.java:296–329  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

294
295
296 @Override
297 public void run() {
298 while (Thread.currentThread() == thread) {
299 try {
300 Socket socket = server.accept();
301 Client client = new Client(parent, socket);
302 synchronized (clientsLock) {
303 addClient(client);
304 if (serverEventMethod != null) {
305 try {
306 serverEventMethod.invoke(parent, this, client);
307 } catch (Exception e) {
308 System.err.println("Disabling serverEvent() for port " + port);
309 Throwable cause = e;
310 // unwrap the exception if it came from the user code
311 if (e instanceof InvocationTargetException && e.getCause() != null) {
312 cause = e.getCause();
313 }
314 cause.printStackTrace();
315 serverEventMethod = null;
316 }
317 }
318 }
319 } catch (SocketException e) {
320 //thrown when server.close() is called and server is waiting on accept
321 System.err.println("Server SocketException: " + e.getMessage());
322 thread = null;
323 } catch (IOException e) {
324 //errorMessage("run", e);
325 e.printStackTrace();
326 thread = null;
327 }
328 }
329 }
330
331
332 /**

Callers

nothing calls this directly

Calls 5

addClientMethod · 0.95
acceptMethod · 0.65
getMessageMethod · 0.65
printlnMethod · 0.45
printStackTraceMethod · 0.45

Tested by

no test coverage detected