Thanks a lot for your response! We will try that.
-Scott
On Thursday, September 18, 2014 7:17:27 PM UTC-6, Scott Ellis wrote:
>
> Hi, before upgrading from 3.x to 5.x, we used to detect if a mongoose
> instance was already running with code like the following:
>
> mg_ctx = mg_start(&handleMongooseEvent, NULL, serverOptions);
> if (!mg_ctx)
> {
> char message[1024];
> sprintf(message,
> "Unable to start mongoose on port: %s\n"
> "The port may already be in use.\n", getListeningPort());
> _die(message);
> }
>
> This was very helpful for our users. Now with 5.4, the following code no
> longer works because create_server still returns a valid mg_server, even if
> another mongoose instance is already running on the same port.
>
>
> mg_server = mg_create_server(NULL, &handleMongooseEvent);
> if (!mg_server)
> {
> // never get here, even if another mongoose is already running on
> the same port
> }
>
>
> What is the recommended way to detect this case and throw an error with
> the new API?
>
> Thanks,
> Scott
>
>
--
You received this message because you are subscribed to the Google Groups
"mongoose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mongoose-users.
For more options, visit https://groups.google.com/d/optout.