Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 4fccfe23f6486142b4197d1daac0cf21 > files > 118

Falcon-doc-0.9.6.6-2.fc15.noarch.rpm

<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <title>Class TCPServer - Class TCPServer</title>
   <link href="faldoc.css" rel="stylesheet" type="text/css"/>
   <link href="tabs.css" rel="stylesheet" type="text/css"/>
</head>
<body class="faldoc_body">
<div class="navitop">
   <div class="tabs">
      <ul>
         <li><a href="./index.html"><span>Main</span></a></li>
         <li><a href="./modules.html"><span>Modules</span></a></li>
         <li><a href="./pages.html"><span>Related pages</span></a></li>
         <li><a href="./groups.html"><span>Groups</span></a></li>
         <li><a href="./classes.html"><span>Classes</span></a></li>
         <li><a href="./objects.html"><span>Objects</span></a></li>
         <li><a href="./functions.html"><span>All functions</span></a></li>
         <li><a href="./enum.html"><span>Enumerations</span></a></li>
         
      </ul>
   </div>
</div>
<hr/>

<h1 class="faldoc_title">Class TCPServer<span class="faldoc_belong"><a href="./module_feather_socket.html">[in Socket]</a></p></h1>

<p class="faldoc_brief">Encapsulates a TCP network service provider. </p>
<p class="faldoc_funcdecl">
<b>class</b> TCPServer
</p>


   <p class="faldoc_brief"><a href="#more">more...</a></p>
   <h2 class="faldoc_title">Summary</h2>
   <table class="faldoc_list">
   
      
         <tr><td><a href="#lastError">lastError</a></td><td>Numeric value of system level error that has occoured on the socket.</td></tr>
      
   
      
         <tr><td><a href="#accept">accept()</a></td><td>Waits for incoming connections. </td></tr>
      
         <tr><td><a href="#bind">bind()</a></td><td>Specify the address and port at which this server will be listening. </td></tr>
      
         <tr><td><a href="#dispose">dispose()</a></td><td>Closes the service and disposes the resources, </td></tr>
      
   
   </table>







<a name="more"><h2 class="faldoc_title">Detailed description</h2></a>

<p class="faldoc_funcdecl">
<b>class</b> TCPServer
</p>
<table class="faldoc_function">


</table>
<br/>
<p class="item_brief">Encapsulates a TCP network service provider. </p>
<p class="faldoc_text">This class is actually a factory of TCPSockets, that are created as incoming connections are received. As such, it is not derived from the Socket class. </p>
<p class="faldoc_text">The constructor reserves system resources needed to create sockets and return a TPCServer object that can be used to accept incoming TCP connections. </p>
<p class="faldoc_text">If the needed system resources are not available, a NetError is raised. </p>




   <h2 class="faldoc_title">Properties</h2>
   
      <h3 class="faldoc_funcname"><a name="lastError">lastError</a></h3>
      <p class="item_brief">Numeric value of system level error that has occoured on the socket.</p>
      
      
      
   

   <h2 class="faldoc_title">Methods</h2>
   
      <h3 class="faldoc_funcname"><a name="accept">accept()</a></h3>
      <p class="item_brief">Waits for incoming connections. </p>
      <p class="faldoc_funcdecl">TCPServer.accept( [timeout] )</p>
      
         <table class="faldoc_function">
         
         <tr><td class="faldoc_optparam">timeout</td><td class="faldoc_optparamdesc">Optional wait time. </td></tr>
         <tr><td class="faldoc_funcreturn">Returns:</td><td class="faldoc_funcreturndesc">A new TCPSocket after a successful connection. </td></tr>
         
            <tr><td class="faldoc_raise">Raises:</td><td class="faldoc_raisedesc">
            <table class="faldoc_raise">
            <tr><td class="faldoc_raiseitem"><a href="./class_NetError.html">NetError</a></td><td class="faldoc_raisedesc">on system error. </td></tr>
            </table>
            </td></tr>
         
         </table>
      
      <p class="faldoc_text"><p class="faldoc_text">This method accepts incoming connection and creates a TCPSocket object that can be used to communicate with the remote host. Before calling accept(), it is necessary to have successfully called bind() to bind the listening application to a certain local address. </p>
<p class="faldoc_text">If a timeout is not specified, the function will block until a TCP connection is received. If it is specified, is a number of millisecond that will be waited before returning a nil. Setting the timeout to zero will cause accept to return immediately, providing a valid TCPSocket as return value only if an incoming connection was already pending. </p>
<p class="faldoc_text">The wait blocks the VM, and thus, also the other coroutines. If a system error occurs during the wait, a NetError is raised. </p>
</p>
   
      <h3 class="faldoc_funcname"><a name="bind">bind()</a></h3>
      <p class="item_brief">Specify the address and port at which this server will be listening. </p>
      <p class="faldoc_funcdecl">TCPServer.bind( addrOrService, [service] )</p>
      
         <table class="faldoc_function">
         <tr><td class="faldoc_param">addrOrService</td><td class="faldoc_paramdesc">Address at which this server will be listening. </td></tr>
         <tr><td class="faldoc_optparam">service</td><td class="faldoc_optparamdesc">If an address is given, service or port number (as a string) where to listen. </td></tr>
         
         
            <tr><td class="faldoc_raise">Raises:</td><td class="faldoc_raisedesc">
            <table class="faldoc_raise">
            <tr><td class="faldoc_raiseitem"><a href="./class_NetError.html">NetError</a></td><td class="faldoc_raisedesc">on system error. </td></tr>
            </table>
            </td></tr>
         
         </table>
      
      <p class="faldoc_text"><p class="faldoc_text">This method binds the server port and start listening for incoming connections. If passing two parameters, the first one is considered to be one of the address that are available on local interfaces; the second one is the port or service name where the server will open a listening port. </p>
<p class="faldoc_text">If an address is not provided, that is, if only one parameter is passed, the server will listen on all the local interfaces. It is possible to specify jolly IPv4 or IPv6 addresses (i.e. "0.0.0.0") to listen on all the interfaces. </p>
<p class="faldoc_text"> In case the system cannot bind the required address, a NetError is raised. After a successful <b>bind</b> call, <a href="./class_TCPServer.html#accept">TCPServer.accept</a> may be called to create TCPSocket that can serve incoming connections. </p>
</p>
   
      <h3 class="faldoc_funcname"><a name="dispose">dispose()</a></h3>
      <p class="item_brief">Closes the service and disposes the resources, </p>
      <p class="faldoc_funcdecl">TCPServer.dispose( )</p>
      
      <p class="faldoc_text"><p class="faldoc_text">Collects immediately this object and frees the related system resources. Using this object after this call causes undefined results. </p>
</p>
   

<hr/>
<div class="navibottom">
   <center>
      <a href="./index.html">Main</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./modules.html">Modules</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./pages.html">Related pages</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./groups.html">Groups</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./classes.html">Classes</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./objects.html">Objects</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./functions.html">All functions</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./enum.html">Enumerations</a>
   </center>
</div>
</div>
<div class="faldoc_signature">Made with <a href="http://www.falconpl.org">faldoc 2.2.0</div>
</body>
</html>