This commit is contained in:
Redkale
2017-03-03 18:21:09 +08:00
parent 8fee6b2c68
commit a8627b6105

View File

@@ -465,13 +465,27 @@ public final class Application {
channel.write(buffer); channel.write(buffer);
buffer.clear(); buffer.clear();
channel.configureBlocking(false); channel.configureBlocking(false);
channel.read(buffer); try {
buffer.flip(); channel.read(buffer);
byte[] bytes = new byte[buffer.remaining()]; buffer.flip();
buffer.get(bytes); byte[] bytes = new byte[buffer.remaining()];
channel.close(); buffer.get(bytes);
logger.info(new String(bytes)); channel.close();
Thread.sleep(500); logger.info(new String(bytes));
Thread.sleep(500);
} catch (Exception e) {
if (e instanceof PortUnreachableException) {
if ("APIDOC".equalsIgnoreCase(command)) {
final Application application = Application.create(true);
application.init();
application.start();
new ApiDocs(application).run();
logger.info("APIDOC OK");
return;
}
}
throw e;
}
} }
public void start() throws Exception { public void start() throws Exception {