Made port public constant
Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
This commit is contained in:
parent
0e422a81ce
commit
171f79518d
@ -46,6 +46,7 @@ import net.bigeon.gclc.ConsoleApplication;
|
|||||||
@SuppressWarnings({ "javadoc", "nls" })
|
@SuppressWarnings({ "javadoc", "nls" })
|
||||||
public class TestServer {
|
public class TestServer {
|
||||||
|
|
||||||
|
public static final int PORT = 3300;
|
||||||
private static SocketConsoleApplicationShell SHELL;
|
private static SocketConsoleApplicationShell SHELL;
|
||||||
private static ConnexionManager<Socket> manager;
|
private static ConnexionManager<Socket> manager;
|
||||||
|
|
||||||
@ -75,7 +76,7 @@ public class TestServer {
|
|||||||
input.setPrompt("> \n");
|
input.setPrompt("> \n");
|
||||||
output = new PluggableConsoleOutput();
|
output = new PluggableConsoleOutput();
|
||||||
manager = new DConnexionManager<>();
|
manager = new DConnexionManager<>();
|
||||||
SHELL = new SocketConsoleApplicationShell(3300,
|
SHELL = new SocketConsoleApplicationShell(PORT,
|
||||||
InetAddress.getByName("127.0.0.1"));
|
InetAddress.getByName("127.0.0.1"));
|
||||||
final ConsoleApplication app = ConsoleTestApplication.create(output, input,
|
final ConsoleApplication app = ConsoleTestApplication.create(output, input,
|
||||||
manager);
|
manager);
|
||||||
@ -91,13 +92,13 @@ public class TestServer {
|
|||||||
});
|
});
|
||||||
th.start();
|
th.start();
|
||||||
try {
|
try {
|
||||||
Object waiting = new Object();
|
final Object waiting = new Object();
|
||||||
synchronized (waiting) {
|
synchronized (waiting) {
|
||||||
while (!input.isPrompting()) {
|
while (!input.isPrompting()) {
|
||||||
waiting.wait(50);
|
waiting.wait(50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (InterruptedException e) {
|
} catch (final InterruptedException e) {
|
||||||
Thread.currentThread().interrupt();
|
Thread.currentThread().interrupt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user