From 5bbd482a199152dae4134095ff55e6a4b078998d Mon Sep 17 00:00:00 2001 From: atomicint Date: Thu, 27 Aug 2015 17:08:41 -0400 Subject: [PATCH] Do not fail startup when HTTP cannot bind --- game/src/main/org/apollo/Server.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/game/src/main/org/apollo/Server.java b/game/src/main/org/apollo/Server.java index ce97141d..f1df758b 100644 --- a/game/src/main/org/apollo/Server.java +++ b/game/src/main/org/apollo/Server.java @@ -60,6 +60,7 @@ public final class Server { server.bind(service, http, jaggrab); } catch (Throwable t) { logger.log(Level.SEVERE, "Error whilst starting server.", t); + System.exit(0); } logger.fine("Starting apollo took " + stopwatch.elapsed(TimeUnit.MILLISECONDS) + " ms."); @@ -102,13 +103,17 @@ public final class Server { * reason. */ public void bind(SocketAddress service, SocketAddress http, SocketAddress jaggrab) throws BindException { - logger.info("Binding service listener to address: " + service + "..."); + logger.fine("Binding service listener to address: " + service + "..."); bind(serviceBootstrap, service); - logger.info("Binding HTTP listener to address: " + http + "..."); - bind(httpBootstrap, http); + try { + logger.fine("Binding HTTP listener to address: " + http + "..."); + bind(httpBootstrap, http); + } catch (Exception cause) { + logger.warning("Unable to bind to HTTP, JAGGRAB will be used as a fallback however this is not recommended."); + } - logger.info("Binding JAGGRAB listener to address: " + jaggrab + "..."); + logger.fine("Binding JAGGRAB listener to address: " + jaggrab + "..."); bind(jaggrabBootstrap, jaggrab); logger.info("Ready for connections.");