public static void main(int intport)
{
VpnServer myVPN = new VpnServer(intport);
myVPN.listen();
}
------
------
public void listen()
{
new Thread(() -> {
while(running.get() && (serverSocket != null) && serverSocket.isBound())
{
try { serviceThreads.add(new RequestHandler(serverSocket.accept())); }
catch(SocketTimeoutException e1) { /* Nothing to do here */ }
catch (IOException e2) { e2.printStackTrace(); }
}
}).start();
}