Permalink
Browse files

Wait for listen to complete

  • Loading branch information...
1 parent e0b1910 commit eb7c653e50327e3bf06b9d316a44f31a29cfb81e @normanmaurer normanmaurer committed Mar 26, 2013
Showing with 9 additions and 4 deletions.
  1. +9 −4 src/main/java/org/vertx/mods/WebServer.java
@@ -18,7 +18,7 @@
import org.vertx.java.busmods.BusModBase;
import org.vertx.java.core.Handler;
-import org.vertx.java.core.file.impl.PathAdjuster;
+import org.vertx.java.core.VoidResult;
import org.vertx.java.core.http.HttpServer;
import org.vertx.java.core.http.HttpServerRequest;
import org.vertx.java.core.json.JsonArray;
@@ -43,8 +43,8 @@
private String indexPage;
private boolean gzipFiles;
- public void start() {
- super.start();
+ public void start(final VoidResult result) {
+ start();
HttpServer server = vertx.createHttpServer();
@@ -75,7 +75,12 @@ public void start() {
webRootPrefix = webRoot + File.separator;
indexPage = webRootPrefix + index;
- server.listen(getOptionalIntConfig("port", 80), getOptionalStringConfig("host", "0.0.0.0"));
+ server.listen(getOptionalIntConfig("port", 80), getOptionalStringConfig("host", "0.0.0.0"), new Handler<HttpServer>() {
+ @Override
+ public void handle(HttpServer event) {
+ result.setResult();
+ }
+ });
}
public void handle(HttpServerRequest req) {

0 comments on commit eb7c653

Please sign in to comment.