mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
added ping + code cleanup
This commit is contained in:
parent
bc5c97c560
commit
b1408507cb
6 changed files with 47 additions and 47 deletions
|
|
@ -103,21 +103,19 @@ public class Main {
|
|||
adminPassword = arg.replace(adminPasswordArg, "");
|
||||
}
|
||||
}
|
||||
String host = config.getServerAddress();
|
||||
int port = config.getPort();
|
||||
Connection connection = new Connection();
|
||||
connection.setHost(config.getServerAddress());
|
||||
connection.setPort(config.getPort());
|
||||
try {
|
||||
if (host.equals("localhost"))
|
||||
host = Connection.getLocalAddress().getHostAddress();
|
||||
String locatorURI = "bisocket://" + host + ":" + port;
|
||||
InvokerLocator serverLocator = new InvokerLocator(locatorURI);
|
||||
InvokerLocator serverLocator = new InvokerLocator(connection.getURI());
|
||||
server = new MageTransporterServer(serverLocator, new MageServerImpl(adminPassword, testMode), MageServer.class.getName(), new MageServerInvocationHandler());
|
||||
server.start();
|
||||
logger.info("Started MAGE server - listening on " + host + ":" + port);
|
||||
logger.info("Started MAGE server - listening on " + connection.toString());
|
||||
if (testMode)
|
||||
logger.info("MAGE server running in test mode");
|
||||
|
||||
} catch (Exception ex) {
|
||||
logger.fatal("Failed to start server - " + host + ":" + port, ex);
|
||||
logger.fatal("Failed to start server - " + connection.toString(), ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue