Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-updates > by-pkgid > 768f7d9f703884aa2562bf0a651086df > files > 1806

qtbase5-doc-5.9.4-1.1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qlocalserver.cpp -->
  <title>QLocalServer Class | Qt Network 5.9</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.9</td><td ><a href="qtnetwork-index.html">Qt Network</a></td><td ><a href="qtnetwork-module.html">C++ Classes</a></td><td >QLocalServer</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#properties">Properties</a></li>
<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>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QLocalServer Class</h1>
<!-- $$$QLocalServer-brief -->
<p>The <a href="qlocalserver.html">QLocalServer</a> class provides a local socket based server. <a href="#details">More...</a></p>
<!-- @@@QLocalServer -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QLocalServer&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += network</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign">  Qt 4.4</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="../qtcore/qobject.html">QObject</a></td></tr></table></div><ul>
<li><a href="qlocalserver-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qlocalserver.html#SocketOption-enum">SocketOption</a></b> { NoOptions, UserAccessOption, GroupAccessOption, OtherAccessOption, WorldAccessOption }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> flags </td><td class="memItemRight bottomAlign"><b><a href="qlocalserver.html#SocketOption-enum">SocketOptions</a></b></td></tr>
</table></div>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<ul>
<li class="fn"><b><a href="qlocalserver.html#socketOptions-prop">socketOptions</a></b> : SocketOptions</li>
</ul>
<ul>
<li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><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> = Q_NULLPTR)</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"> bool </td><td class="memItemRight bottomAlign"><b><a href="qlocalserver.html#listen-1">listen</a></b>(qintptr <i>socketDescriptor</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"> void </td><td class="memItemRight bottomAlign"><b><a href="qlocalserver.html#socketOptions-prop">setSocketOptions</a></b>(SocketOptions <i>options</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> SocketOptions </td><td class="memItemRight bottomAlign"><b><a href="qlocalserver.html#socketOptions">socketOptions</a></b>() const</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> = Q_NULLPTR)</td></tr>
</table></div>
<ul>
<li class="fn">32 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li>
</ul>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<div class="table"><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></div>
<ul>
<li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li>
</ul>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><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></div>
<ul>
<li class="fn">10 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li>
</ul>
<a name="protected-functions"></a>
<h2 id="protected-functions">Protected Functions</h2>
<div class="table"><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></div>
<ul>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li>
<li class="fn">1 public variable inherited from <a href="../qtcore/qobject.html#public-variables">QObject</a></li>
<li class="fn">2 protected variables inherited from <a href="../qtcore/qobject.html#protected-variables">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QLocalServer-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qlocalserver.html">QLocalServer</a> 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 <a href="qlocalserver.html">QLocalServer</a> stop listening for incoming connections.</p>
<p>Although <a href="qlocalserver.html">QLocalServer</a> 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="types">
<h2>Member Type Documentation</h2>
<!-- $$$SocketOption$$$NoOptions$$$UserAccessOption$$$GroupAccessOption$$$OtherAccessOption$$$WorldAccessOption -->
<h3 class="flags" id="SocketOption-enum"><a name="SocketOption-enum"></a>enum QLocalServer::<span class="name">SocketOption</span><br/>flags QLocalServer::<span class="name">SocketOptions</span></h3>
<p>This enum describes the possible options that can be used to create the socket. This changes the access permissions on platforms (Linux, Windows) that support access permissions on the socket. Both GroupAccess and OtherAccess may vary slightly in meanings depending on the platform.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QLocalServer::NoOptions</code></td><td class="topAlign tblval"><code>0x0</code></td><td class="topAlign">No access restrictions have been set.</td></tr>
<tr><td class="topAlign"><code>QLocalServer::UserAccessOption</code></td><td class="topAlign tblval"><code>0x01</code></td><td class="topAlign">Access is restricted to the same user as the process that created the socket.</td></tr>
<tr><td class="topAlign"><code>QLocalServer::GroupAccessOption</code></td><td class="topAlign tblval"><code>0x2</code></td><td class="topAlign">Access is restricted to the same group but not the user that created the socket on Linux. Access is restricted to the primary group of the process on Windows</td></tr>
<tr><td class="topAlign"><code>QLocalServer::OtherAccessOption</code></td><td class="topAlign tblval"><code>0x4</code></td><td class="topAlign">Access is available to everyone but the user and group that created the socket on Linux. Access is available to everyone on Windows.</td></tr>
<tr><td class="topAlign"><code>QLocalServer::WorldAccessOption</code></td><td class="topAlign tblval"><code>0x7</code></td><td class="topAlign">No access restrictions.</td></tr>
</table></div>
<p>This enum was introduced or modified in  Qt 5.0.</p>
<p>The SocketOptions type is a typedef for <a href="../qtcore/qflags.html">QFlags</a>&lt;SocketOption&gt;. It stores an OR combination of SocketOption values.</p>
<p><b>See also </b><a href="qlocalserver.html#socketOptions-prop">socketOptions</a>.</p>
<!-- @@@SocketOption -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$socketOptions-prop$$$socketOptions$$$setSocketOptionsSocketOptions -->
<h3 class="fn" id="socketOptions-prop"><a name="socketOptions-prop"></a><span class="name">socketOptions</span> : <span class="type"><a href="qlocalserver.html#SocketOption-enum">SocketOptions</a></span></h3>
<p>The setSocketOptions method controls how the socket operates. For example the socket may restrict access to what user ids can connect to the socket.</p>
<p>These options must be set before <a href="qlocalserver.html#listen">listen</a>() is called.</p>
<p>In some cases, such as with Unix domain sockets on Linux, the access to the socket will be determined by file system permissions, and are created based on the umask. Setting the access flags will overide this and will restrict or permit access as specified.</p>
<p>Other Unix-based operating systems, such as macOS, do not honor file permissions for Unix domain sockets and by default have WorldAccess and these permission flags will have no effect.</p>
<p>On Windows, <a href="qlocalserver.html#SocketOption-enum">UserAccessOption</a> is sufficient to allow a non elevated process to connect to a local server created by an elevated process run by the same user. <a href="qlocalserver.html#SocketOption-enum">GroupAccessOption</a> refers to the primary group of the process (see TokenPrimaryGroup in the Windows documentation). <a href="qlocalserver.html#SocketOption-enum">OtherAccessOption</a> refers to the well known &quot;Everyone&quot; group.</p>
<p>By default none of the flags are set, access permissions are the platform default.</p>
<p>This property was introduced in  Qt 5.0.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> SocketOptions </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qlocalserver.html#socketOptions">socketOptions</a></b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setSocketOptions</b></span>(SocketOptions <i>options</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qlocalserver.html#listen">listen</a>().</p>
<!-- @@@socketOptions -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QLocalServer[overload1]$$$QLocalServerQObject* -->
<h3 class="fn" id="QLocalServer"><a name="QLocalServer"></a>QLocalServer::<span class="name">QLocalServer</span>(<span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>parent</i> = Q_NULLPTR)</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" id="dtor.QLocalServer"><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" id="close"><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 affected, 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" id="errorString"><a name="errorString"></a><span class="type"><a href="../qtcore/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" id="fullServerName"><a name="fullServerName"></a><span class="type"><a href="../qtcore/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" id="hasPendingConnections"><a name="hasPendingConnections"></a><code>[virtual] </code><span class="type">bool</span> QLocalServer::<span class="name">hasPendingConnections</span>() const</h3>
<p>Returns <code>true</code> if the server has a pending connection; otherwise returns <code>false</code>.</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" id="incomingConnection"><a name="incomingConnection"></a><code>[virtual protected] </code><span class="type">void</span> QLocalServer::<span class="name">incomingConnection</span>(<span class="type"><a href="../qtcore/qtglobal.html#quintptr-typedef">quintptr</a></span> <i>socketDescriptor</i>)</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" id="isListening"><a name="isListening"></a><span class="type">bool</span> QLocalServer::<span class="name">isListening</span>() const</h3>
<p>Returns <code>true</code> 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" id="listen"><a name="listen"></a><span class="type">bool</span> QLocalServer::<span class="name">listen</span>(const <span class="type"><a href="../qtcore/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><b>Note: </b>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 -->
<!-- $$$listen$$$listenqintptr -->
<h3 class="fn" id="listen-1"><a name="listen-1"></a><span class="type">bool</span> QLocalServer::<span class="name">listen</span>(<span class="type"><a href="../qtcore/qtglobal.html#qintptr-typedef">qintptr</a></span> <i>socketDescriptor</i>)</h3>
<p>Instructs the server to listen for incoming connections on <i>socketDescriptor</i>. The property returns <code>false</code> if the server is currently listening. It returns <code>true</code> on success; otherwise, it returns <code>false</code>. The socket must be ready to accept new connections with no extra platform-specific functions called. The socket is set into non-blocking mode.</p>
<p><a href="qlocalserver.html#serverName">serverName</a>(), <a href="qlocalserver.html#fullServerName">fullServerName</a>() may return a string with a name if this option is supported by the platform; otherwise, they return an empty <a href="../qtcore/qstring.html">QString</a>.</p>
<p>This function was introduced in  Qt 5.0.</p>
<p><b>See also </b><a href="qlocalserver.html#isListening">isListening</a>() and <a href="qlocalserver.html#close">close</a>().</p>
<!-- @@@listen -->
<!-- $$$maxPendingConnections[overload1]$$$maxPendingConnections -->
<h3 class="fn" id="maxPendingConnections"><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" id="newConnection"><a name="newConnection"></a><code>[signal] </code><span class="type">void</span> QLocalServer::<span class="name">newConnection</span>()</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" id="nextPendingConnection"><a name="nextPendingConnection"></a><code>[virtual] </code><span class="type"><a href="qlocalsocket.html">QLocalSocket</a></span> *QLocalServer::<span class="name">nextPendingConnection</span>()</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" id="removeServer"><a name="removeServer"></a><code>[static] </code><span class="type">bool</span> QLocalServer::<span class="name">removeServer</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>name</i>)</h3>
<p>Removes any server instance that might cause a call to <a href="qlocalserver.html#listen">listen</a>() to fail and returns <code>true</code> if successful; otherwise returns <code>false</code>. 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" id="serverError"><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" id="serverName"><a name="serverName"></a><span class="type"><a href="../qtcore/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" id="setMaxPendingConnections"><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 -->
<!-- $$$socketOptions -->
<h3 class="fn" id="socketOptions"><a name="socketOptions"></a><span class="type"><a href="qlocalserver.html#SocketOption-enum">SocketOptions</a></span> QLocalServer::<span class="name">socketOptions</span>() const</h3>
<p>Returns the socket options set on the socket.</p>
<p>This function was introduced in  Qt 5.0.</p>
<p><b>Note:</b> Getter function for property <a href="qlocalserver.html#socketOptions-prop">socketOptions</a>. </p><p><b>See also </b><a href="qlocalserver.html#socketOptions-prop">setSocketOptions</a>().</p>
<!-- @@@socketOptions -->
<!-- $$$waitForNewConnection[overload1]$$$waitForNewConnectionintbool* -->
<h3 class="fn" id="waitForNewConnection"><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> = Q_NULLPTR)</h3>
<p>Waits for at most <i>msec</i> milliseconds or until an incoming connection is available. Returns <code>true</code> if a connection is available; otherwise returns <code>false</code>. 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>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    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.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>