public AbstractDummyClient connect(int port) {
connectPort = port;
connected = false;
listener = new Listener();
try {
SocketEndpoint endpoint =
new SocketEndpoint(
new InetSocketAddress(InetAddress.getLocalHost(), port),
TransportType.RELIABLE);
connector = endpoint.createConnector();
connector.connect(listener);
} catch (Exception e) {
System.err.println(toString() + " connect throws: " + e);
e.printStackTrace();
throw new RuntimeException("DummyClient.connect failed", e);