IMO, library devs do a big disservice to the Processing community (who are very tweaky by nature
) by using the keyword private or leaving the default package access level. 
As we can confirm from class Server’s source code: 
Both fields thread & server were left as package-protected access level. And many other fields as well btW! 
We could use reflection to force access to them all. But it’s too convoluted & a hassle! 
A much clever workaround is to make a “.java” file for our “hacked” Server subclass, which is HServer. 
And then “lie” that the “HServer.java” file belongs to package “processing.net” too! 
All of a sudden all those package-protected members become accessible to our custom HServer subclass! 
Here’s my take on that: 
“HServer.java”
package processing.net;
import java.io.IOException;
import processing.core.PApplet;
public class HServer extends Server {
public HServer(PApplet parent, int port) {
this(parent, port, null);
}
public HServer(PApplet parent, int port, String host) {
super(parent, port, host);
}
@Override public void dispose() {
thread = null;
if (clients != null) {
disconnectAll();
clientCount = 0;
clients = null;
}
try {
if (server != null) {
server.close();
server = null;
}
}
catch (final IOException e) {
//e.printStackTrace();
}
}
}