summaryrefslogtreecommitdiff
path: root/spectro/mongoose.h
diff options
context:
space:
mode:
Diffstat (limited to 'spectro/mongoose.h')
-rw-r--r--spectro/mongoose.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/spectro/mongoose.h b/spectro/mongoose.h
index 708cf73..1ee0c47 100644
--- a/spectro/mongoose.h
+++ b/spectro/mongoose.h
@@ -107,11 +107,23 @@ typedef void *(*mg_callback_t)(enum mg_event event, struct mg_connection *conn);
// Please refer to http://code.google.com/p/mongoose/wiki/MongooseManual
// for the list of valid option and their possible values.
//
+// If one of the listening ports is "0", then it will be automatically
+// allocated to a free port by the system, and the port that gets allocated
+// may be retrieved by calling mg_get_listening_port() bellow.
+//
// Return:
// web server context, or NULL on error.
struct mg_context *mg_start(mg_callback_t callback, void *user_data,
const char **options);
+// Get the allocated port number of the first port 0 listener,
+// or the last non-0 port listener.
+// Return 0 on error
+int mg_get_listening_port(struct mg_context *ctx);
+
+// Get a URL for accessing the server. */
+// Return NULL on error. Free after use.
+char *mg_get_url(struct mg_context *ctx);
// Stop the web server.
//