Re: SERVICE_CONTROL_STOP not received
From: Arkady Frenkel (arkadyf_at_hotmailxdotx.com)
Date: 07/29/04
- Next message: Jan Newger: "Re: prevent close dialog in console app"
- Previous message: poltrone: "Re: Best option for 'idle wait'"
- In reply to: howard: "SERVICE_CONTROL_STOP not received"
- Next in thread: howard: "Re: SERVICE_CONTROL_STOP not received"
- Reply: howard: "Re: SERVICE_CONTROL_STOP not received"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 29 Jul 2004 10:22:26 +0300
Look at http://www.microsoft.com/msj/1097/winnt.aspx
and http://www.microsoft.com/msj/0298/service.aspx
Arkady
"howard" <anonymous@discussions.microsoft.com> wrote in message
news:60bb01c474ea$102bed20$a401280a@phx.gbl...
> hi folks,
>
> I hope this is the right place to post this daunting
> problem.
>
> I created a service, the ServiceMain() will start a socket
> server ( TCP ). The socket server is wrapped in a class
> from a 3rd party library.
>
> This service is working pretty well on 2k and XP. Once
> it's started,it could handle the requests from the client
> without any problem. However, if I tried to stop the
> service, I get an error message from SCM - "error 1053:
> The service did not respond to the start or control
> request in a timely fashion".
>
> My first reaction is that the service doesn't finish on
> time. But eventually i found that SERVICE_CONTROL_STOP is
> not received by the main thread ( which runs main() and
> StartServiceCtrlDispatcher() ). Spy++ shows that status of
> the main thread is "wait" and the reason is "Executive",
> status of the service thread ( which runs ServiceMain() )
> is "Wait" and the reason is "User Request" )
>
> I also found out that if the service was started and no
> client would send any request to it, it could be stopped
> without any problem. Both the main thread and service
> thread looked exactly the same in spy++ as they did in
> previous test.
>
> The problem turned out to be that main thread didn't
> receive SERVICE_CONTROL_STOP at all in certain
> circumstances. And it seemed that this is caused by some
> problem in the socket server, as everything worked
> perfectly if the socket server didn't get any request.
>
> I'm wondering if anyone have seen this, and give me a
> hint. What will prevent the main thread from receiving
> SERVICE_CONTRL_STOP or other control messages from SCM ?
> Is there any work around for this ? How does the SCM send
> the SERVICE_CONTROL_xxx command to a service ?
>
> Any input would be greatly appreciated
>
> thanks in advance
> howard
>
>
>
- Next message: Jan Newger: "Re: prevent close dialog in console app"
- Previous message: poltrone: "Re: Best option for 'idle wait'"
- In reply to: howard: "SERVICE_CONTROL_STOP not received"
- Next in thread: howard: "Re: SERVICE_CONTROL_STOP not received"
- Reply: howard: "Re: SERVICE_CONTROL_STOP not received"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|