<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Start RPC Server</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="yar-server.construct.html">Yar_Server::__construct</a></div> <div class="next" style="text-align: right; float: right;"><a href="class.yar-client.html">Yar_Client</a></div> <div class="up"><a href="class.yar-server.html">Yar_Server</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="yar-server.handle" class="refentry"> <div class="refnamediv"> <h1 class="refname">Yar_Server::handle</h1> <p class="verinfo">(PECL yar >= 1.0.0)</p><p class="refpurpose"><span class="refname">Yar_Server::handle</span> — <span class="dc-title">Start RPC Server</span></p> </div> <div class="refsect1 description" id="refsect1-yar-server.handle-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">boolean</span> <span class="methodname"><strong>Yar_Server::handle</strong></span> ( <span class="methodparam">void</span> )</div> <p class="para rdfs-comment"> Start a RPC HTTP server, and ready for accpet RPC requests. <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> Usual RPC calls will be issued as HTTP POST requests. If a HTTP GET request is issued to the uri, the service information (commented section above) will be printed on the page </p> </p></blockquote> </p> </div> <div class="refsect1 parameters" id="refsect1-yar-server.handle-parameters"> <h3 class="title">Parameters</h3> <p class="para">This function has no parameters.</p> </div> <div class="refsect1 returnvalues" id="refsect1-yar-server.handle-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> boolean </p> </div> <div class="refsect1 examples" id="refsect1-yar-server.handle-examples"> <h3 class="title">Examples</h3> <div class="example" id="example-5339"> <p><strong>Example #1 <span class="function"><strong>Yar_Server::handle()</strong></span> example</strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br /></span><span style="color: #007700">class </span><span style="color: #0000BB">API </span><span style="color: #007700">{<br /> </span><span style="color: #FF8000">/**<br /> * the doc info will be generated automatically into service info page.<br /> * @params <br /> * @return<br /> */<br /> </span><span style="color: #007700">public function </span><span style="color: #0000BB">some_method</span><span style="color: #007700">(</span><span style="color: #0000BB">$parameter</span><span style="color: #007700">, </span><span style="color: #0000BB">$option </span><span style="color: #007700">= </span><span style="color: #DD0000">"foo"</span><span style="color: #007700">) {<br /> }<br /><br /> protected function </span><span style="color: #0000BB">client_can_not_see</span><span style="color: #007700">() {<br /> }<br />}<br /><br /></span><span style="color: #0000BB">$service </span><span style="color: #007700">= new </span><span style="color: #0000BB">Yar_Server</span><span style="color: #007700">(new </span><span style="color: #0000BB">API</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">$service</span><span style="color: #007700">-></span><span style="color: #0000BB">handle</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> <div class="example-contents"><p>The above example will output something similar to:</p></div> <div class="example-contents screen"> <div class="cdata"><pre> </pre></div> </div> </div> </div> <div class="refsect1 seealso" id="refsect1-yar-server.handle-seealso"> <h3 class="title">See Also</h3> <ul class="simplelist"> <li class="member"> <span class="methodname"><a href="yar-server.construct.html" class="methodname" rel="rdfs-seeAlso">Yar_Server::__construct()</a> - Register a server</span></li> </ul> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="yar-server.construct.html">Yar_Server::__construct</a></div> <div class="next" style="text-align: right; float: right;"><a href="class.yar-client.html">Yar_Client</a></div> <div class="up"><a href="class.yar-server.html">Yar_Server</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>