Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > ff187cb994c94c614ecc64c5a8528b1b > files > 5683

qt-doc-4.8.5-10.fc18.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qlocalserver.cpp -->
  <title>Qt 4.8: QLocalServer Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtnetwork.html">QtNetwork</a></li>
<li>QLocalServer</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QLocalServer Class Reference</h1>
<!-- $$$QLocalServer-brief -->
<p>The QLocalServer class provides a local socket based server. <a href="#details">More...</a></p>
<!-- @@@QLocalServer -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QLocalServer&gt;</span></pre><p><b>Inherits: </b><a href="qobject.html">QObject</a>.</p>
<p>This class was introduced in Qt 4.4.</p>
<ul>
<li><a href="qlocalserver-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qlocalserver.html#QLocalServer">QLocalServer</a></b> ( QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qlocalserver.html#dtor.QLocalServer">~QLocalServer</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlocalserver.html#close">close</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qlocalserver.html#errorString">errorString</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qlocalserver.html#fullServerName">fullServerName</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qlocalserver.html#hasPendingConnections">hasPendingConnections</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qlocalserver.html#isListening">isListening</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qlocalserver.html#listen">listen</a></b> ( const QString &amp; <i>name</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qlocalserver.html#maxPendingConnections">maxPendingConnections</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QLocalSocket * </td><td class="memItemRight bottomAlign"><b><a href="qlocalserver.html#nextPendingConnection">nextPendingConnection</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAbstractSocket::SocketError </td><td class="memItemRight bottomAlign"><b><a href="qlocalserver.html#serverError">serverError</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qlocalserver.html#serverName">serverName</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlocalserver.html#setMaxPendingConnections">setMaxPendingConnections</a></b> ( int <i>numConnections</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qlocalserver.html#waitForNewConnection">waitForNewConnection</a></b> ( int <i>msec</i> = 0, bool * <i>timedOut</i> = 0 )</td></tr>
</table>
<ul>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
</ul>
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlocalserver.html#newConnection">newConnection</a></b> ()</td></tr>
</table>
<ul>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qlocalserver.html#removeServer">removeServer</a></b> ( const QString &amp; <i>name</i> )</td></tr>
</table>
<ul>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
</ul>
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qlocalserver.html#incomingConnection">incomingConnection</a></b> ( quintptr <i>socketDescriptor</i> )</td></tr>
</table>
<ul>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QLocalServer-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QLocalServer class provides a local socket based server.</p>
<p>This class makes it possible to accept incoming local socket connections.</p>
<p>Call <a href="qlocalserver.html#listen">listen</a>() to have the server start listening for incoming connections on a specified key. The <a href="qlocalserver.html#newConnection">newConnection</a>() signal is then emitted each time a client connects to the server.</p>
<p>Call <a href="qlocalserver.html#nextPendingConnection">nextPendingConnection</a>() to accept the pending connection as a connected <a href="qlocalsocket.html">QLocalSocket</a>. The function returns a pointer to a <a href="qlocalsocket.html">QLocalSocket</a> that can be used for communicating with the client.</p>
<p>If an error occurs, <a href="qlocalserver.html#serverError">serverError</a>() returns the type of error, and <a href="qlocalserver.html#errorString">errorString</a>() can be called to get a human readable description of what happened.</p>
<p>When listening for connections, the name which the server is listening on is available through <a href="qlocalserver.html#serverName">serverName</a>().</p>
<p>Calling <a href="qlocalserver.html#close">close</a>() makes QLocalServer stop listening for incoming connections.</p>
<p>Although QLocalServer is designed for use with an event loop, it's possible to use it without one. In that case, you must use <a href="qlocalserver.html#waitForNewConnection">waitForNewConnection</a>(), which blocks until either a connection is available or a timeout expires.</p>
</div>
<p><b>See also </b><a href="qlocalsocket.html">QLocalSocket</a> and <a href="qtcpserver.html">QTcpServer</a>.</p>
<!-- @@@QLocalServer -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QLocalServer[overload1]$$$QLocalServerQObject* -->
<h3 class="fn"><a name="QLocalServer"></a>QLocalServer::<span class="name">QLocalServer</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
<p>Create a new local socket server with the given <i>parent</i>.</p>
<p><b>See also </b><a href="qlocalserver.html#listen">listen</a>().</p>
<!-- @@@QLocalServer -->
<!-- $$$~QLocalServer[overload1]$$$~QLocalServer -->
<h3 class="fn"><a name="dtor.QLocalServer"></a>QLocalServer::<span class="name">~QLocalServer</span> ()</h3>
<p>Destroys the <a href="qlocalserver.html">QLocalServer</a> object. If the server is listening for connections, it is automatically closed.</p>
<p>Any client QLocalSockets that are still connected must either disconnect or be reparented before the server is deleted.</p>
<p><b>See also </b><a href="qlocalserver.html#close">close</a>().</p>
<!-- @@@~QLocalServer -->
<!-- $$$close[overload1]$$$close -->
<h3 class="fn"><a name="close"></a><span class="type">void</span> QLocalServer::<span class="name">close</span> ()</h3>
<p>Stop listening for incoming connections. Existing connections are not effected, but any new connections will be refused.</p>
<p><b>See also </b><a href="qlocalserver.html#isListening">isListening</a>() and <a href="qlocalserver.html#listen">listen</a>().</p>
<!-- @@@close -->
<!-- $$$errorString[overload1]$$$errorString -->
<h3 class="fn"><a name="errorString"></a><span class="type"><a href="qstring.html">QString</a></span> QLocalServer::<span class="name">errorString</span> () const</h3>
<p>Returns the human-readable message appropriate to the current error reported by <a href="qlocalserver.html#serverError">serverError</a>(). If no suitable string is available, an empty string is returned.</p>
<p><b>See also </b><a href="qlocalserver.html#serverError">serverError</a>().</p>
<!-- @@@errorString -->
<!-- $$$fullServerName[overload1]$$$fullServerName -->
<h3 class="fn"><a name="fullServerName"></a><span class="type"><a href="qstring.html">QString</a></span> QLocalServer::<span class="name">fullServerName</span> () const</h3>
<p>Returns the full path that the server is listening on.</p>
<p>Note: This is platform specific</p>
<p><b>See also </b><a href="qlocalserver.html#listen">listen</a>() and <a href="qlocalserver.html#serverName">serverName</a>().</p>
<!-- @@@fullServerName -->
<!-- $$$hasPendingConnections[overload1]$$$hasPendingConnections -->
<h3 class="fn"><a name="hasPendingConnections"></a><span class="type">bool</span> QLocalServer::<span class="name">hasPendingConnections</span> () const<tt> [virtual]</tt></h3>
<p>Returns true if the server has a pending connection; otherwise returns false.</p>
<p><b>See also </b><a href="qlocalserver.html#nextPendingConnection">nextPendingConnection</a>() and <a href="qlocalserver.html#setMaxPendingConnections">setMaxPendingConnections</a>().</p>
<!-- @@@hasPendingConnections -->
<!-- $$$incomingConnection[overload1]$$$incomingConnectionquintptr -->
<h3 class="fn"><a name="incomingConnection"></a><span class="type">void</span> QLocalServer::<span class="name">incomingConnection</span> ( <span class="type"><a href="qtglobal.html#quintptr-typedef">quintptr</a></span> <i>socketDescriptor</i> )<tt> [virtual protected]</tt></h3>
<p>This virtual function is called by <a href="qlocalserver.html">QLocalServer</a> when a new connection is available. <i>socketDescriptor</i> is the native socket descriptor for the accepted connection.</p>
<p>The base implementation creates a <a href="qlocalsocket.html">QLocalSocket</a>, sets the socket descriptor and then stores the <a href="qlocalsocket.html">QLocalSocket</a> in an internal list of pending connections. Finally <a href="qlocalserver.html#newConnection">newConnection</a>() is emitted.</p>
<p>Reimplement this function to alter the server's behavior when a connection is available.</p>
<p><b>See also </b><a href="qlocalserver.html#newConnection">newConnection</a>(), <a href="qlocalserver.html#nextPendingConnection">nextPendingConnection</a>(), and <a href="qlocalsocket.html#setSocketDescriptor">QLocalSocket::setSocketDescriptor</a>().</p>
<!-- @@@incomingConnection -->
<!-- $$$isListening[overload1]$$$isListening -->
<h3 class="fn"><a name="isListening"></a><span class="type">bool</span> QLocalServer::<span class="name">isListening</span> () const</h3>
<p>Returns true if the server is listening for incoming connections otherwise false.</p>
<p><b>See also </b><a href="qlocalserver.html#listen">listen</a>() and <a href="qlocalserver.html#close">close</a>().</p>
<!-- @@@isListening -->
<!-- $$$listen[overload1]$$$listenconstQString& -->
<h3 class="fn"><a name="listen"></a><span class="type">bool</span> QLocalServer::<span class="name">listen</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>name</i> )</h3>
<p>Tells the server to listen for incoming connections on <i>name</i>. If the server is currently listening then it will return false. Return true on success otherwise false.</p>
<p><i>name</i> can be a single name and <a href="qlocalserver.html">QLocalServer</a> will determine the correct platform specific path. <a href="qlocalserver.html#serverName">serverName</a>() will return the name that is passed into listen.</p>
<p>Usually you would just pass in a name like &quot;foo&quot;, but on Unix this could also be a path such as &quot;/tmp/foo&quot; and on Windows this could be a pipe path such as &quot;\\.\pipe\foo&quot;</p>
<p>Note: On Unix if the server crashes without closing listen will fail with AddressInUseError. To create a new server the file should be removed. On Windows two local servers can listen to the same pipe at the same time, but any connections will go to one of the server.</p>
<p><b>See also </b><a href="qlocalserver.html#serverName">serverName</a>(), <a href="qlocalserver.html#isListening">isListening</a>(), and <a href="qlocalserver.html#close">close</a>().</p>
<!-- @@@listen -->
<!-- $$$maxPendingConnections[overload1]$$$maxPendingConnections -->
<h3 class="fn"><a name="maxPendingConnections"></a><span class="type">int</span> QLocalServer::<span class="name">maxPendingConnections</span> () const</h3>
<p>Returns the maximum number of pending accepted connections. The default is 30.</p>
<p><b>See also </b><a href="qlocalserver.html#setMaxPendingConnections">setMaxPendingConnections</a>() and <a href="qlocalserver.html#hasPendingConnections">hasPendingConnections</a>().</p>
<!-- @@@maxPendingConnections -->
<!-- $$$newConnection[overload1]$$$newConnection -->
<h3 class="fn"><a name="newConnection"></a><span class="type">void</span> QLocalServer::<span class="name">newConnection</span> ()<tt> [signal]</tt></h3>
<p>This signal is emitted every time a new connection is available.</p>
<p><b>See also </b><a href="qlocalserver.html#hasPendingConnections">hasPendingConnections</a>() and <a href="qlocalserver.html#nextPendingConnection">nextPendingConnection</a>().</p>
<!-- @@@newConnection -->
<!-- $$$nextPendingConnection[overload1]$$$nextPendingConnection -->
<h3 class="fn"><a name="nextPendingConnection"></a><span class="type"><a href="qlocalsocket.html">QLocalSocket</a></span> * QLocalServer::<span class="name">nextPendingConnection</span> ()<tt> [virtual]</tt></h3>
<p>Returns the next pending connection as a connected <a href="qlocalsocket.html">QLocalSocket</a> object.</p>
<p>The socket is created as a child of the server, which means that it is automatically deleted when the <a href="qlocalserver.html">QLocalServer</a> object is destroyed. It is still a good idea to delete the object explicitly when you are done with it, to avoid wasting memory.</p>
<p>0 is returned if this function is called when there are no pending connections.</p>
<p><b>See also </b><a href="qlocalserver.html#hasPendingConnections">hasPendingConnections</a>(), <a href="qlocalserver.html#newConnection">newConnection</a>(), and <a href="qlocalserver.html#incomingConnection">incomingConnection</a>().</p>
<!-- @@@nextPendingConnection -->
<!-- $$$removeServer[overload1]$$$removeServerconstQString& -->
<h3 class="fn"><a name="removeServer"></a><span class="type">bool</span> QLocalServer::<span class="name">removeServer</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>name</i> )<tt> [static]</tt></h3>
<p>Removes any server instance that might cause a call to <a href="qlocalserver.html#listen">listen</a>() to fail and returns true if successful; otherwise returns false. This function is meant to recover from a crash, when the previous server instance has not been cleaned up.</p>
<p>On Windows, this function does nothing; on Unix, it removes the socket file given by <i>name</i>.</p>
<p><b>Warning:</b> Be careful to avoid removing sockets of running instances.</p>
<p>This function was introduced in Qt 4.5.</p>
<!-- @@@removeServer -->
<!-- $$$serverError[overload1]$$$serverError -->
<h3 class="fn"><a name="serverError"></a><span class="type"><a href="qabstractsocket.html#SocketError-enum">QAbstractSocket::SocketError</a></span> QLocalServer::<span class="name">serverError</span> () const</h3>
<p>Returns the type of error that occurred last or NoError.</p>
<p><b>See also </b><a href="qlocalserver.html#errorString">errorString</a>().</p>
<!-- @@@serverError -->
<!-- $$$serverName[overload1]$$$serverName -->
<h3 class="fn"><a name="serverName"></a><span class="type"><a href="qstring.html">QString</a></span> QLocalServer::<span class="name">serverName</span> () const</h3>
<p>Returns the server name if the server is listening for connections; otherwise returns QString()</p>
<p><b>See also </b><a href="qlocalserver.html#listen">listen</a>() and <a href="qlocalserver.html#fullServerName">fullServerName</a>().</p>
<!-- @@@serverName -->
<!-- $$$setMaxPendingConnections[overload1]$$$setMaxPendingConnectionsint -->
<h3 class="fn"><a name="setMaxPendingConnections"></a><span class="type">void</span> QLocalServer::<span class="name">setMaxPendingConnections</span> ( <span class="type">int</span> <i>numConnections</i> )</h3>
<p>Sets the maximum number of pending accepted connections to <i>numConnections</i>. <a href="qlocalserver.html">QLocalServer</a> will accept no more than <i>numConnections</i> incoming connections before <a href="qlocalserver.html#nextPendingConnection">nextPendingConnection</a>() is called.</p>
<p>Note: Even though <a href="qlocalserver.html">QLocalServer</a> will stop accepting new connections after it has reached its maximum number of pending connections, the operating system may still keep them in queue which will result in clients signaling that it is connected.</p>
<p><b>See also </b><a href="qlocalserver.html#maxPendingConnections">maxPendingConnections</a>() and <a href="qlocalserver.html#hasPendingConnections">hasPendingConnections</a>().</p>
<!-- @@@setMaxPendingConnections -->
<!-- $$$waitForNewConnection[overload1]$$$waitForNewConnectionintbool* -->
<h3 class="fn"><a name="waitForNewConnection"></a><span class="type">bool</span> QLocalServer::<span class="name">waitForNewConnection</span> ( <span class="type">int</span> <i>msec</i> = 0, <span class="type">bool</span> * <i>timedOut</i> = 0 )</h3>
<p>Waits for at most <i>msec</i> milliseconds or until an incoming connection is available. Returns true if a connection is available; otherwise returns false. If the operation timed out and <i>timedOut</i> is not 0, *timedOut will be set to true.</p>
<p>This is a blocking function call. Its use is ill-advised in a single-threaded GUI application, since the whole application will stop responding until the function returns. waitForNewConnection() is mostly useful when there is no event loop available.</p>
<p>The non-blocking alternative is to connect to the <a href="qlocalserver.html#newConnection">newConnection</a>() signal.</p>
<p>If msec is -1, this function will not time out.</p>
<p><b>See also </b><a href="qlocalserver.html#hasPendingConnections">hasPendingConnections</a>() and <a href="qlocalserver.html#nextPendingConnection">nextPendingConnection</a>().</p>
<!-- @@@waitForNewConnection -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Digia, Qt and their respective logos are trademarks of Digia Plc 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>