Artifact
b367a5d023a6aa2649cc451ec0777b67f035771a:
Wiki page
[Embedding] by
gerald
2012-10-31 06:40:43.
D 2012-10-31T06:40:43.167
L Embedding
P 2688e2d3574da610c2fe5aeada8075c99f1f9014
U gerald
W 3292
<TABLE class=toc id=toc>
<TR>
<TD>
<DIV id=toctitle>
<H2>Contents</H2></DIV>
<UL>
<LI class=toclevel-1><A href="#Loading_the_Webservices_Embedded_Package"><SPAN
class=tocnumber>1</SPAN> <SPAN class=toctext>Loading the Webservices
Embedded Package</SPAN></A>
<LI class=toclevel-1><A href="#Listen"><SPAN
class=tocnumber>2</SPAN> <SPAN class=toctext>Specify a Port to Receive Request on</SPAN></A>
<LI class=toclevel-1><A href="#Start"><SPAN
class=tocnumber>3</SPAN> <SPAN class=toctext>Start Listening for Requests</SPAN></A>
<LI class=toclevel-1><A href="#Stop"><SPAN
class=tocnumber>4</SPAN> <SPAN class=toctext>Stop Listening for Requests</SPAN></A>
</UL>
</TD>
</TR>
</TABLE>
<A name=Loading_the_Webservices_Embedded_Package></A>
<H2>Loading the Webservices Server Package </H2>
<P>To load the webservices server package, do: </P><PRE> package require WS::Embedded
</PRE>
<P>This command will only load the server the first time it is used, so it
causes no ill effects to put this in each file declaring a service or service
procedure. </P>
<HR>
<A name=Listen></A>
<H2>Specify a Port to Receive Request on</H2>
<P><B>Procedure Name : <I>::WS::Embeded::Listen</I></B> </P>
<P><B>Description</B> : Instruct the module to listen on a Port, security information.
<P><B>Arguments</B> : this procedure uses position dependent arguments,
they are: </P>
<PRE>
<I>port </I> -- Port number to listen on.
<I>certfile</I> -- Name of the certificate file. Defaults to {}.
<I>keyfile </I> -- Name of the key file. Defaults to {}.
<I>userpwds</I> -- A list of username and passwords. Defaults to {}.
<I>realm </I> -- The seucrity realm. Defaults to {}.
<I>logger </I> -- A logging routines for errors. Defaults to ::WS::Embeded::logger.
</PRE>
<P><B>Returns</B> : Handle of socket </P>
<P><B>Side-Effects</B> : None </P>
<P><B>Exception Conditions</B> : : None </P>
<P><B>Pre-requisite Conditions</B> : None </P>
<HR>
<A name=Start></A>
<H2>Start Listening for Requests</H2>
<P><B>Procedure Name : <I>::WS::Embeded::Start</I></B> </P>
<P><B>Description</B> : Start listening on all ports (i.e. enter the event loop). </P>
<P><B>Arguments</B> : None</P>
<P><B>Returns</B> : Value that event loop was exited with. </P>
<P><B>Side-Effects</B> : Nothing</P>
<P><B>Exception Conditions</B> : None </P>
<P><B>Pre-requisite Conditions</B> : </P>
<ul>
<p>::WS::Embeded::Listen should have been called for one or more port.</p>
</ul>
<HR>
<A name=Stop></A>
<H2>Stop Listening for Requests</H2>
<P><B>Procedure Name : <I>::WS::Embeded::Stop</I></B> </P>
<P><B>Description</B> : Stop listening on all ports (i.e. enter the event loop). </P>
<P><B>Arguments</B> :</P>
<PRE>
value -- Value that ::WS::Embedded::Start should return
</PRE>
<P><B>Returns</B> : Nothing </P>
<P><B>Side-Effects</B> : Nothing</P>
<P><B>Exception Conditions</B> : None </P>
<P><B>Pre-requisite Conditions</B> : </P>
<ul>
<p>::WS::Embeded::Start should have been called.</p>
</ul>
Z 8c9247875b30223992023129b0f4b060