Hi Max,

 

See below for the finishing piece of  WebServer code (error occurs after the 
server code, after return 0;}) and the code of the standard communication 
function WebServer<==> SCM (CallBackSvcCtrlHandler).

=========

//…

                while (m_iExit_flag == 0)

                    mg_poll_server(server, 1000);

                // Cleanup, and free server instances

                mg_destroy_server(&server);

                return 0;

}//<==ERROR HEAR

==========

VOID WINAPI CallBackSvcCtrlHandler( DWORD dwCtrl )

{

                // Handle the requested control code. 

                switch(dwCtrl) 

                {  

                                case SERVICE_CONTROL_STOP: 

                                                
ReportSvcStatus(SERVICE_STOP_PENDING, NO_ERROR, 0);

                                                // Signal the service to stop.

                                                SetEvent(g_StopEvent);

                                                
ReportSvcStatus(g_ServiceStatus.dwCurrentState, NO_ERROR, 0);

                                                m_iExit_flag = 1;

                                                return;

                                case SERVICE_CONTROL_INTERROGATE: 

                                                break; 

                                default: 

                                                break;

                } 

                SetServiceStatus (g_ServiceStatusHandle, &g_ServiceStatus);

                return; 

}

 

From: mongoose-users@googlegroups.com [mailto:mongoose-users@googlegroups.com] 
On Behalf Of Max Ignatenko
Sent: Thursday, July 02, 2015 5:52 PM
To: mongoose-users@googlegroups.com
Subject: Re: Error 1067: The process terminated unexpectedly

 

Hi Oleg,

Can you provide a stacktrace or pinpoint where it crashes in some other way? 
Without that and without your code it's pretty hard to speculate about what 
goes wrong.

That said, I doubt that the problem is in the Mongoose itself, official Windows 
binary registers itself as a service and runs without any problems.

 

On Thu, Jul 2, 2015 at 3:26 PM <oleg.gore...@apollo.lv> wrote:

Hi. I use the Mongoose 5.6 as a base to develop my WEB Server.

If WEB Server registered as a COM object, it starts and stops correctly.

If it registered as a service, it starts and functions correctly, but when you 
stop the service (Stop in SCM) it fails (a diagnostic message - Windows could 
not stop ... service on Local Computer. Error 1067: The process terminated 
unexpectedly).

Binding WEB Server with SCM performed exactly the same functions, which are 
successfully used in the code of my other servers are not designed on the basis 
of Mongoose.

Where could be the problem?

 

-- 
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 mongoose-users+unsubscr...@googlegroups.com.
To post to this group, send email to mongoose-users@googlegroups.com.
Visit this group at http://groups.google.com/group/mongoose-users.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to a topic in the Google 
Groups "mongoose-users" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/mongoose-users/VGh7Ll1fFhE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
mongoose-users+unsubscr...@googlegroups.com.
To post to this group, send email to mongoose-users@googlegroups.com.
Visit this group at http://groups.google.com/group/mongoose-users.
For more options, visit https://groups.google.com/d/optout.

-- 
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 mongoose-users+unsubscr...@googlegroups.com.
To post to this group, send email to mongoose-users@googlegroups.com.
Visit this group at http://groups.google.com/group/mongoose-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to