Re: SERVICE_CONTROL_STOP not received

From: Arkady Frenkel (arkadyf_at_hotmailxdotx.com)
Date: 07/29/04


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
>
>
>



Relevant Pages

  • Re: read receipts
    ... that the "request" is actually made by the transmitting client, ... the receiving server. ... reaching the client software. ... Verifying that the client is receiving them should be pretty easy. ...
    (microsoft.public.exchange.admin)
  • Re: Session Variables
    ... The default is 20 minutes after the last request from the client. ... server has no way of knowing what the client does after receiving a request, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: logging via SocketHandler and TCPserver
    ... handles every request in a different thread. ... I guess I was trying to not use up bandwidth/CPU cycles on the applications that weren't being actively monitored by just not having the socket server connected to them. ... "Brain surgery is easy to a brain surgeon". ... Logging docs are quite good as a reference, ...
    (comp.lang.python)
  • Re: UserHostAddress question
    ... the receiving end for its packets which are then forwarded to the client. ... All that ASP.NET knows is that it receives a request from an IP ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: breaking the model
    ... > The forms data then is in the Request object. ... HTTP Request; in this case, the form POST Request from the Page. ... client and server. ...
    (microsoft.public.dotnet.framework.aspnet)