php-doc-en/reference/win32service/functions/win32-start-service-ctrl-dispatcher.xml
Wez Furlong 6e04852458 document win32 service extension
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@196256 c90b9560-bf6c-de11-be94-00142212c4b1
2005-09-17 16:26:44 +00:00

114 lines
3.1 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<!-- Generated by xml_proto.php v2.3. Found in /scripts directory of phpdoc. -->
<refentry id="function.win32-start-service-ctrl-dispatcher">
<refnamediv>
<refname>win32_start_service_ctrl_dispatcher</refname>
<refpurpose>Registers the script with the SCM, so that it can act as the service with the given name</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>win32_start_service_ctrl_dispatcher</methodname>
<methodparam><type>string</type><parameter>name</parameter></methodparam>
</methodsynopsis>
<para>
When launched via the Service Control Manager, a service process is
required to "check-in" with it to establish service monitoring and
communication facilities. This function performs the check-in by spawning
a thread to handle the lower-level communication with the service control
manager.
</para>
<para>
Once started, the service process should continue to check-in with the
service control manager so that it can determine if it should terminate.
This is achieved by periodically calling
<function>win32_get_last_control_message</function> and handling the return
code appropriately.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>name</parameter></term>
<listitem>
<para>
The short-name of the service, as registered by
<function>win32_create_service</function>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>A <function>win32_start_service_ctrl_dispatcher</function> example</title>
<para>
Any text that describes the purpose of the example, or
what goes on in the example should go here (inside the
</para>
<programlisting role="php">
<![CDATA[
<?php
if (!win32_start_service_ctrl_dispatcher('dummyphp')) {
die("I'm probably not running under the service control manager");
}
while (WIN32_SERVICE_CONTROL_STOP != win32_get_last_control_message()) {
# do some work here, trying not to take more than around 30 seconds
# before coming back into the loop again
}
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>win32_get_last_control_message</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->