This file is indexed.

/usr/share/qt5/doc/qtwebsockets/qwebsocketserver.html is in qtwebsockets5-doc-html 5.3.2-5.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.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" />
<!-- qwebsocketserver.cpp -->
  <title>QWebSocketServer Class | QtWebSockets 5.3</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
    <div class="main">
    <div class="main-rounded">
        <div class="navigationbar">
        <ul>
<li>Qt 5.3</li>
<li><a href="qtwebsockets-index.html">Qt WebSockets</a></li>
<li><a href="qtwebsockets-module.html">C++ Classes</a></li>
<li>QWebSocketServer</li>
<li id="buildversion">
Qt 5.3.2 Reference Documentation</li>
    </ul>
    </div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<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="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QWebSocketServer Class</h1>
<!-- $$$QWebSocketServer-brief -->
<p>Implements a <a href="qml-qt-websockets-websocket.html">WebSocket</a>-based server. <a href="#details">More...</a></p>
<!-- @@@QWebSocketServer -->
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> </b><tt><span class="preprocessor">#include &lt;QWebSocketServer&gt;</span>
</tt></td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> <tt>QT += websockets</tt></td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="../qtcore/qobject.html">QObject</a>.</td></tr></table><ul>
<li><a href="qwebsocketserver-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#SslMode-enum">SslMode</a></b> { SecureMode, NonSecureMode }</td></tr>
</table>
<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="qwebsocketserver.html#QWebSocketServer">QWebSocketServer</a></b>(const QString &amp;<i> serverName</i>, SslMode<i> secureMode</i>, QObject *<i> parent</i> = 0)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#dtor.QWebSocketServer">~QWebSocketServer</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#close">close</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWebSocketProtocol::CloseCode </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#error">error</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#errorString">errorString</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#hasPendingConnections">hasPendingConnections</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#isListening">isListening</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#listen">listen</a></b>(const QHostAddress &amp;<i> address</i> = QHostAddress::Any, quint16<i> port</i> = 0)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#maxPendingConnections">maxPendingConnections</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QWebSocket * </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#nextPendingConnection">nextPendingConnection</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#pauseAccepting">pauseAccepting</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QNetworkProxy </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#proxy">proxy</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#resumeAccepting">resumeAccepting</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> SslMode </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#secureMode">secureMode</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QHostAddress </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#serverAddress">serverAddress</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#serverName">serverName</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> quint16 </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#serverPort">serverPort</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.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="qwebsocketserver.html#setProxy">setProxy</a></b>(const QNetworkProxy &amp;<i> networkProxy</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#setServerName">setServerName</a></b>(const QString &amp;<i> serverName</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#setSocketDescriptor">setSocketDescriptor</a></b>(int<i> socketDescriptor</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#setSslConfiguration">setSslConfiguration</a></b>(const QSslConfiguration &amp;<i> sslConfiguration</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#socketDescriptor">socketDescriptor</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSslConfiguration </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#sslConfiguration">sslConfiguration</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QWebSocketProtocol::Version&gt; </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#supportedVersions">supportedVersions</a></b>() const</td></tr>
</table>
<ul>
<li class="fn">31 public functions inherited from <a href="../qtcore/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="qwebsocketserver.html#acceptError">acceptError</a></b>(QAbstractSocket::SocketError<i> socketError</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#closed">closed</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#newConnection">newConnection</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#originAuthenticationRequired">originAuthenticationRequired</a></b>(QWebSocketCorsAuthenticator *<i> authenticator</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#peerVerifyError">peerVerifyError</a></b>(const QSslError &amp;<i> error</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#serverError">serverError</a></b>(QWebSocketProtocol::CloseCode<i> closeCode</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebsocketserver.html#sslErrors">sslErrors</a></b>(const QList&lt;QSslError&gt; &amp;<i> errors</i>)</td></tr>
</table>
<ul>
<li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</a></li>
<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">10 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">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>
<!-- $$$QWebSocketServer-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>Implements a <a href="qml-qt-websockets-websocket.html">WebSocket</a>-based server.</p>
<p>It is modeled after <a href="../qtnetwork/qtcpserver.html">QTcpServer</a>, and behaves the same. So, if you know how to use <a href="../qtnetwork/qtcpserver.html">QTcpServer</a>, you know how to use QWebSocketServer. This class makes it possible to accept incoming <a href="qml-qt-websockets-websocket.html">WebSocket</a> connections. You can specify the port or have QWebSocketServer pick one automatically. You can listen on a specific address or on all the machine's addresses. Call <a href="qwebsocketserver.html#listen">listen</a>() to have the server listen for incoming connections.</p>
<p>The <a href="qwebsocketserver.html#newConnection">newConnection</a>() signal is then emitted each time a client connects to the server. Call <a href="qwebsocketserver.html#nextPendingConnection">nextPendingConnection</a>() to accept the pending connection as a connected <a href="qwebsocket.html">QWebSocket</a>. The function returns a pointer to a <a href="qwebsocket.html">QWebSocket</a> in <a href="../qtnetwork/qabstractsocket.html#SocketState-enum">QAbstractSocket::ConnectedState</a> that you can use for communicating with the client.</p>
<p>If an error occurs, <a href="qwebsocketserver.html#serverError">serverError</a>() returns the type of error, and <a href="qwebsocketserver.html#errorString">errorString</a>() can be called to get a human readable description of what happened.</p>
<p>When listening for connections, the address and port on which the server is listening are available as <a href="qwebsocketserver.html#serverAddress">serverAddress</a>() and <a href="qwebsocketserver.html#serverPort">serverPort</a>().</p>
<p>Calling <a href="qwebsocketserver.html#close">close</a>() makes QWebSocketServer stop listening for incoming connections.</p>
<p>QWebSocketServer currently does not support <a href="http://tools.ietf.org/html/rfc6455#page-39">extensions</a> and <a href="http://tools.ietf.org/html/rfc6455#page-12">subprotocols</a>.</p>
<p><b>Note: </b>When working with self-signed certificates, FireFox currently has a <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=594502">bug</a> that prevents it to connect to a secure <a href="qml-qt-websockets-websocket.html">WebSocket</a> server. To work around this problem, first browse to the secure <a href="qml-qt-websockets-websocket.html">WebSocket</a> server using HTTPS. FireFox will indicate that the certificate is invalid. From here on, the certificate can be added to the exceptions. After this, the secure WebSockets connection should work.</p><p>QWebSocketServer only supports version 13 of the <a href="qml-qt-websockets-websocket.html">WebSocket</a> protocol, as outlined in RFC 6455.</p>
</div>
<p><b>See also </b><a href="echoserver.html">WebSocket Server Example</a> and <a href="qwebsocket.html">QWebSocket</a>.</p>
<!-- @@@QWebSocketServer -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$SslMode$$$SecureMode$$$NonSecureMode -->
<h3 class="fn"><a name="SslMode-enum"></a>enum QWebSocketServer::<span class="name">SslMode</span></h3>
<p>Indicates whether the server operates over wss (SecureMode) or ws (NonSecureMode)</p>
<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"><tt>QWebSocketServer::SecureMode</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">The server operates in secure mode (over wss)</td></tr>
<tr><td class="topAlign"><tt>QWebSocketServer::NonSecureMode</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">The server operates in non-secure mode (over ws)</td></tr>
</table>
<!-- @@@SslMode -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QWebSocketServer[overload1]$$$QWebSocketServerconstQString&SslModeQObject* -->
<h3 class="fn"><a name="QWebSocketServer"></a>QWebSocketServer::<span class="name">QWebSocketServer</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i> serverName</i>, <span class="type"><a href="qwebsocketserver.html#SslMode-enum">SslMode</a></span><i> secureMode</i>, <span class="type"><a href="../qtcore/qobject.html">QObject</a></span> *<i> parent</i> = 0)</h3>
<p>Constructs a new <a href="qwebsocketserver.html">QWebSocketServer</a> with the given <i>serverName</i>. The <i>serverName</i> will be used in the HTTP handshake phase to identify the server. It can be empty, in which case an empty server name will be sent to the client. The <i>secureMode</i> parameter indicates whether the server operates over wss (<a href="qwebsocketserver.html#SslMode-enum">SecureMode</a>) or over ws (<a href="qwebsocketserver.html#SslMode-enum">NonSecureMode</a>).</p>
<p><i>parent</i> is passed to the <a href="../qtcore/qobject.html">QObject</a> constructor.</p>
<!-- @@@QWebSocketServer -->
<!-- $$$~QWebSocketServer[overload1]$$$~QWebSocketServer -->
<h3 class="fn"><a name="dtor.QWebSocketServer"></a>QWebSocketServer::<span class="name">~QWebSocketServer</span>()<tt> [virtual]</tt></h3>
<p>Destroys the <a href="qwebsocketserver.html">QWebSocketServer</a> object. If the server is listening for connections, the socket is automatically closed. Any client <a href="qwebsocket.html">QWebSocket</a>s that are still queued are closed and deleted.</p>
<p><b>See also </b><a href="qwebsocketserver.html#close">close</a>().</p>
<!-- @@@~QWebSocketServer -->
<!-- $$$acceptError[overload1]$$$acceptErrorQAbstractSocket::SocketError -->
<h3 class="fn"><a name="acceptError"></a><span class="type">void</span> QWebSocketServer::<span class="name">acceptError</span>(<span class="type"><a href="../qtnetwork/qabstractsocket.html#SocketError-enum">QAbstractSocket::SocketError</a></span><i> socketError</i>)<tt> [signal]</tt></h3>
<p>This signal is emitted when the acceptance of a new connection results in an error. The <i>socketError</i> parameter describes the type of error that occurred.</p>
<p><b>See also </b><a href="qwebsocketserver.html#pauseAccepting">pauseAccepting</a>() and <a href="qwebsocketserver.html#resumeAccepting">resumeAccepting</a>().</p>
<!-- @@@acceptError -->
<!-- $$$close[overload1]$$$close -->
<h3 class="fn"><a name="close"></a><span class="type">void</span> QWebSocketServer::<span class="name">close</span>()</h3>
<p>Closes the server. The server will no longer listen for incoming connections.</p>
<!-- @@@close -->
<!-- $$$closed[overload1]$$$closed -->
<h3 class="fn"><a name="closed"></a><span class="type">void</span> QWebSocketServer::<span class="name">closed</span>()<tt> [signal]</tt></h3>
<p>This signal is emitted when the server closed its connection.</p>
<p><b>See also </b><a href="qwebsocketserver.html#close">close</a>().</p>
<!-- @@@closed -->
<!-- $$$error[overload1]$$$error -->
<h3 class="fn"><a name="error"></a><span class="type"><a href="qwebsocketprotocol.html#CloseCode-enum">QWebSocketProtocol::CloseCode</a></span> QWebSocketServer::<span class="name">error</span>() const</h3>
<p>Returns an error code for the last error that occurred. If no error occurred, <a href="qwebsocketprotocol.html#CloseCode-enum">QWebSocketProtocol::CloseCodeNormal</a> is returned.</p>
<p><b>See also </b><a href="qwebsocketserver.html#errorString">errorString</a>().</p>
<!-- @@@error -->
<!-- $$$errorString[overload1]$$$errorString -->
<h3 class="fn"><a name="errorString"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QWebSocketServer::<span class="name">errorString</span>() const</h3>
<p>Returns a human readable description of the last error that occurred. If no error occurred, an empty string is returned.</p>
<p><b>See also </b><a href="qwebsocketserver.html#serverError">serverError</a>().</p>
<!-- @@@errorString -->
<!-- $$$hasPendingConnections[overload1]$$$hasPendingConnections -->
<h3 class="fn"><a name="hasPendingConnections"></a><span class="type">bool</span> QWebSocketServer::<span class="name">hasPendingConnections</span>() const</h3>
<p>Returns true if the server has pending connections; otherwise returns false.</p>
<p><b>See also </b><a href="qwebsocketserver.html#nextPendingConnection">nextPendingConnection</a>() and <a href="qwebsocketserver.html#setMaxPendingConnections">setMaxPendingConnections</a>().</p>
<!-- @@@hasPendingConnections -->
<!-- $$$isListening[overload1]$$$isListening -->
<h3 class="fn"><a name="isListening"></a><span class="type">bool</span> QWebSocketServer::<span class="name">isListening</span>() const</h3>
<p>Returns true if the server is currently listening for incoming connections; otherwise returns false. If listening fails, <a href="qwebsocketserver.html#error">error</a>() will return the reason.</p>
<p><b>See also </b><a href="qwebsocketserver.html#listen">listen</a>() and <a href="qwebsocketserver.html#error">error</a>().</p>
<!-- @@@isListening -->
<!-- $$$listen[overload1]$$$listenconstQHostAddress&quint16 -->
<h3 class="fn"><a name="listen"></a><span class="type">bool</span> QWebSocketServer::<span class="name">listen</span>(const <span class="type"><a href="../qtnetwork/qhostaddress.html">QHostAddress</a></span> &amp;<i> address</i> = QHostAddress::Any, <span class="type"><a href="../qtcore/qtglobal.html#quint16-typedef">quint16</a></span><i> port</i> = 0)</h3>
<p>Tells the server to listen for incoming connections on address <i>address</i> and port <i>port</i>. If <i>port</i> is 0, a port is chosen automatically. If <i>address</i> is <a href="../qtnetwork/qhostaddress.html#SpecialAddress-enum">QHostAddress::Any</a>, the server will listen on all network interfaces.</p>
<p>Returns true on success; otherwise returns false.</p>
<p><b>See also </b><a href="qwebsocketserver.html#isListening">isListening</a>().</p>
<!-- @@@listen -->
<!-- $$$maxPendingConnections[overload1]$$$maxPendingConnections -->
<h3 class="fn"><a name="maxPendingConnections"></a><span class="type">int</span> QWebSocketServer::<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="qwebsocketserver.html#setMaxPendingConnections">setMaxPendingConnections</a>() and <a href="qwebsocketserver.html#hasPendingConnections">hasPendingConnections</a>().</p>
<!-- @@@maxPendingConnections -->
<!-- $$$newConnection[overload1]$$$newConnection -->
<h3 class="fn"><a name="newConnection"></a><span class="type">void</span> QWebSocketServer::<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="qwebsocketserver.html#hasPendingConnections">hasPendingConnections</a>() and <a href="qwebsocketserver.html#nextPendingConnection">nextPendingConnection</a>().</p>
<!-- @@@newConnection -->
<!-- $$$nextPendingConnection[overload1]$$$nextPendingConnection -->
<h3 class="fn"><a name="nextPendingConnection"></a><span class="type"><a href="qwebsocket.html">QWebSocket</a></span> * QWebSocketServer::<span class="name">nextPendingConnection</span>()<tt> [virtual]</tt></h3>
<p>Returns the next pending connection as a connected <a href="qwebsocket.html">QWebSocket</a> object. <a href="qwebsocketserver.html">QWebSocketServer</a> does not take ownership of the returned <a href="qwebsocket.html">QWebSocket</a> object. It is up to the caller to delete the object explicitly when it will no longer be used, otherwise a memory leak will occur. Q_NULLPTR is returned if this function is called when there are no pending connections.</p>
<p>Note: The returned <a href="qwebsocket.html">QWebSocket</a> object cannot be used from another thread.</p>
<p><b>See also </b><a href="qwebsocketserver.html#hasPendingConnections">hasPendingConnections</a>().</p>
<!-- @@@nextPendingConnection -->
<!-- $$$originAuthenticationRequired[overload1]$$$originAuthenticationRequiredQWebSocketCorsAuthenticator* -->
<h3 class="fn"><a name="originAuthenticationRequired"></a><span class="type">void</span> QWebSocketServer::<span class="name">originAuthenticationRequired</span>(<span class="type"><a href="qwebsocketcorsauthenticator.html">QWebSocketCorsAuthenticator</a></span> *<i> authenticator</i>)<tt> [signal]</tt></h3>
<p>This signal is emitted when a new connection is requested. The slot connected to this signal should indicate whether the origin (which can be determined by the origin() call) is allowed in the <i>authenticator</i> object (by issuing <a href="qwebsocketcorsauthenticator.html#setAllowed">setAllowed()</a>).</p>
<p>If no slot is connected to this signal, all origins will be accepted by default.</p>
<p><b>Note: </b>It is not possible to use a QueuedConnection to connect to this signal, as the connection will always succeed.</p><!-- @@@originAuthenticationRequired -->
<!-- $$$pauseAccepting[overload1]$$$pauseAccepting -->
<h3 class="fn"><a name="pauseAccepting"></a><span class="type">void</span> QWebSocketServer::<span class="name">pauseAccepting</span>()</h3>
<p>Pauses incoming new connections. Queued connections will remain in queue.</p>
<p><b>See also </b><a href="qwebsocketserver.html#resumeAccepting">resumeAccepting</a>().</p>
<!-- @@@pauseAccepting -->
<!-- $$$peerVerifyError[overload1]$$$peerVerifyErrorconstQSslError& -->
<h3 class="fn"><a name="peerVerifyError"></a><span class="type">void</span> QWebSocketServer::<span class="name">peerVerifyError</span>(const <span class="type"><a href="../qtnetwork/qsslerror.html">QSslError</a></span> &amp;<i> error</i>)<tt> [signal]</tt></h3>
<p><a href="qwebsocketserver.html">QWebSocketServer</a> can emit this signal several times during the SSL handshake, before encryption has been established, to indicate that an error has occurred while establishing the identity of the peer. The <i>error</i> is usually an indication that <a href="qwebsocketserver.html">QWebSocketServer</a> is unable to securely identify the peer.</p>
<p>This signal provides you with an early indication when something is wrong. By connecting to this signal, you can manually choose to tear down the connection from inside the connected slot before the handshake has completed. If no action is taken, <a href="qwebsocketserver.html">QWebSocketServer</a> will proceed to emitting <a href="qwebsocketserver.html#sslErrors">QWebSocketServer::sslErrors</a>().</p>
<p><b>See also </b><a href="qwebsocketserver.html#sslErrors">sslErrors</a>().</p>
<!-- @@@peerVerifyError -->
<!-- $$$proxy[overload1]$$$proxy -->
<h3 class="fn"><a name="proxy"></a><span class="type"><a href="../qtnetwork/qnetworkproxy.html">QNetworkProxy</a></span> QWebSocketServer::<span class="name">proxy</span>() const</h3>
<p>Returns the network proxy for this server. By default <a href="../qtnetwork/qnetworkproxy.html#ProxyType-enum">QNetworkProxy::DefaultProxy</a> is used.</p>
<p><b>See also </b><a href="qwebsocketserver.html#setProxy">setProxy</a>().</p>
<!-- @@@proxy -->
<!-- $$$resumeAccepting[overload1]$$$resumeAccepting -->
<h3 class="fn"><a name="resumeAccepting"></a><span class="type">void</span> QWebSocketServer::<span class="name">resumeAccepting</span>()</h3>
<p>Resumes accepting new connections.</p>
<p><b>See also </b><a href="qwebsocketserver.html#pauseAccepting">pauseAccepting</a>().</p>
<!-- @@@resumeAccepting -->
<!-- $$$secureMode[overload1]$$$secureMode -->
<h3 class="fn"><a name="secureMode"></a><span class="type"><a href="qwebsocketserver.html#SslMode-enum">SslMode</a></span> QWebSocketServer::<span class="name">secureMode</span>() const</h3>
<p>Returns the secure mode the server is running in.</p>
<p><b>See also </b><a href="qwebsocketserver.html#QWebSocketServer">QWebSocketServer</a>() and <a href="qwebsocketserver.html#SslMode-enum">SslMode</a>.</p>
<!-- @@@secureMode -->
<!-- $$$serverAddress[overload1]$$$serverAddress -->
<h3 class="fn"><a name="serverAddress"></a><span class="type"><a href="../qtnetwork/qhostaddress.html">QHostAddress</a></span> QWebSocketServer::<span class="name">serverAddress</span>() const</h3>
<p>Returns the server's address if the server is listening for connections; otherwise returns <a href="../qtnetwork/qhostaddress.html#SpecialAddress-enum">QHostAddress::Null</a>.</p>
<p><b>See also </b><a href="qwebsocketserver.html#serverPort">serverPort</a>() and <a href="qwebsocketserver.html#listen">listen</a>().</p>
<!-- @@@serverAddress -->
<!-- $$$serverError[overload1]$$$serverErrorQWebSocketProtocol::CloseCode -->
<h3 class="fn"><a name="serverError"></a><span class="type">void</span> QWebSocketServer::<span class="name">serverError</span>(<span class="type"><a href="qwebsocketprotocol.html#CloseCode-enum">QWebSocketProtocol::CloseCode</a></span><i> closeCode</i>)<tt> [signal]</tt></h3>
<p>This signal is emitted when an error occurs during the setup of a <a href="qml-qt-websockets-websocket.html">WebSocket</a> connection. The <i>closeCode</i> parameter describes the type of error that occurred</p>
<p><b>See also </b><a href="qwebsocketserver.html#errorString">errorString</a>().</p>
<!-- @@@serverError -->
<!-- $$$serverName[overload1]$$$serverName -->
<h3 class="fn"><a name="serverName"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QWebSocketServer::<span class="name">serverName</span>() const</h3>
<p>Returns the server name that is used during the http handshake phase.</p>
<p><b>See also </b><a href="qwebsocketserver.html#setServerName">setServerName</a>().</p>
<!-- @@@serverName -->
<!-- $$$serverPort[overload1]$$$serverPort -->
<h3 class="fn"><a name="serverPort"></a><span class="type"><a href="../qtcore/qtglobal.html#quint16-typedef">quint16</a></span> QWebSocketServer::<span class="name">serverPort</span>() const</h3>
<p>Returns the server's port if the server is listening for connections; otherwise returns 0.</p>
<p><b>See also </b><a href="qwebsocketserver.html#serverAddress">serverAddress</a>() and <a href="qwebsocketserver.html#listen">listen</a>().</p>
<!-- @@@serverPort -->
<!-- $$$setMaxPendingConnections[overload1]$$$setMaxPendingConnectionsint -->
<h3 class="fn"><a name="setMaxPendingConnections"></a><span class="type">void</span> QWebSocketServer::<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>. WebSocketServer will accept no more than <i>numConnections</i> incoming connections before <a href="qwebsocketserver.html#nextPendingConnection">nextPendingConnection</a>() is called. By default, the limit is 30 pending connections.</p>
<p><a href="qwebsocketserver.html">QWebSocketServer</a> will emit the <a href="qwebsocketserver.html#error">error</a>() signal with the <a href="qwebsocketprotocol.html#CloseCode-enum">QWebSocketProtocol::CloseCodeAbnormalDisconnection</a> close code when the maximum of connections has been reached. The <a href="qml-qt-websockets-websocket.html">WebSocket</a> handshake will fail and the socket will be closed.</p>
<p><b>See also </b><a href="qwebsocketserver.html#maxPendingConnections">maxPendingConnections</a>() and <a href="qwebsocketserver.html#hasPendingConnections">hasPendingConnections</a>().</p>
<!-- @@@setMaxPendingConnections -->
<!-- $$$setProxy[overload1]$$$setProxyconstQNetworkProxy& -->
<h3 class="fn"><a name="setProxy"></a><span class="type">void</span> QWebSocketServer::<span class="name">setProxy</span>(const <span class="type"><a href="../qtnetwork/qnetworkproxy.html">QNetworkProxy</a></span> &amp;<i> networkProxy</i>)</h3>
<p>Sets the explicit network proxy for this server to <i>networkProxy</i>.</p>
<p>To disable the use of a proxy, use the <a href="../qtnetwork/qnetworkproxy.html#ProxyType-enum">QNetworkProxy::NoProxy</a> proxy type:</p>
<pre class="cpp">server<span class="operator">-</span><span class="operator">&gt;</span>setProxy(<span class="type"><a href="../qtnetwork/qnetworkproxy.html">QNetworkProxy</a></span><span class="operator">::</span>NoProxy);</pre>
<p><b>See also </b><a href="qwebsocketserver.html#proxy">proxy</a>().</p>
<!-- @@@setProxy -->
<!-- $$$setServerName[overload1]$$$setServerNameconstQString& -->
<h3 class="fn"><a name="setServerName"></a><span class="type">void</span> QWebSocketServer::<span class="name">setServerName</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i> serverName</i>)</h3>
<p>Sets the server name that will be used during the HTTP handshake phase to the given <i>serverName</i>. The <i>serverName</i> can be empty, in which case an empty server name will be sent to the client. Existing connected clients will not be notified of this change, only newly connecting clients will see this new name.</p>
<p><b>See also </b><a href="qwebsocketserver.html#serverName">serverName</a>().</p>
<!-- @@@setServerName -->
<!-- $$$setSocketDescriptor[overload1]$$$setSocketDescriptorint -->
<h3 class="fn"><a name="setSocketDescriptor"></a><span class="type">bool</span> QWebSocketServer::<span class="name">setSocketDescriptor</span>(<span class="type">int</span><i> socketDescriptor</i>)</h3>
<p>Sets the socket descriptor this server should use when listening for incoming connections to <i>socketDescriptor</i>.</p>
<p>Returns true if the socket is set successfully; otherwise returns false. The socket is assumed to be in listening state.</p>
<p><b>See also </b><a href="qwebsocketserver.html#socketDescriptor">socketDescriptor</a>() and <a href="qwebsocketserver.html#isListening">isListening</a>().</p>
<!-- @@@setSocketDescriptor -->
<!-- $$$setSslConfiguration[overload1]$$$setSslConfigurationconstQSslConfiguration& -->
<h3 class="fn"><a name="setSslConfiguration"></a><span class="type">void</span> QWebSocketServer::<span class="name">setSslConfiguration</span>(const <span class="type"><a href="../qtnetwork/qsslconfiguration.html">QSslConfiguration</a></span> &amp;<i> sslConfiguration</i>)</h3>
<p>Sets the SSL configuration for the <a href="qwebsocketserver.html">QWebSocketServer</a> to <i>sslConfiguration</i>. This method has no effect if <a href="qwebsocketserver.html">QWebSocketServer</a> runs in non-secure mode (<a href="qwebsocketserver.html#SslMode-enum">QWebSocketServer::NonSecureMode</a>).</p>
<p><b>See also </b><a href="qwebsocketserver.html#sslConfiguration">sslConfiguration</a>() and <a href="qwebsocketserver.html#SslMode-enum">SslMode</a>.</p>
<!-- @@@setSslConfiguration -->
<!-- $$$socketDescriptor[overload1]$$$socketDescriptor -->
<h3 class="fn"><a name="socketDescriptor"></a><span class="type">int</span> QWebSocketServer::<span class="name">socketDescriptor</span>() const</h3>
<p>Returns the native socket descriptor the server uses to listen for incoming instructions, or -1 if the server is not listening. If the server is using <a href="../qtnetwork/qnetworkproxy.html">QNetworkProxy</a>, the returned descriptor may not be usable with native socket functions.</p>
<p><b>See also </b><a href="qwebsocketserver.html#setSocketDescriptor">setSocketDescriptor</a>() and <a href="qwebsocketserver.html#isListening">isListening</a>().</p>
<!-- @@@socketDescriptor -->
<!-- $$$sslConfiguration[overload1]$$$sslConfiguration -->
<h3 class="fn"><a name="sslConfiguration"></a><span class="type"><a href="../qtnetwork/qsslconfiguration.html">QSslConfiguration</a></span> QWebSocketServer::<span class="name">sslConfiguration</span>() const</h3>
<p>Returns the SSL configuration used by the <a href="qwebsocketserver.html">QWebSocketServer</a>. If the server is not running in secure mode (<a href="qwebsocketserver.html#SslMode-enum">QWebSocketServer::SecureMode</a>), this method returns <a href="../qtnetwork/qsslconfiguration.html#defaultConfiguration">QSslConfiguration::defaultConfiguration</a>().</p>
<p><b>See also </b><a href="qwebsocketserver.html#setSslConfiguration">setSslConfiguration</a>(), <a href="qwebsocketserver.html#SslMode-enum">SslMode</a>, and <a href="../qtnetwork/qsslconfiguration.html#defaultConfiguration">QSslConfiguration::defaultConfiguration</a>().</p>
<!-- @@@sslConfiguration -->
<!-- $$$sslErrors[overload1]$$$sslErrorsconstQList<QSslError>& -->
<h3 class="fn"><a name="sslErrors"></a><span class="type">void</span> QWebSocketServer::<span class="name">sslErrors</span>(const <span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="../qtnetwork/qsslerror.html">QSslError</a></span>&gt; &amp;<i> errors</i>)<tt> [signal]</tt></h3>
<p><a href="qwebsocketserver.html">QWebSocketServer</a> emits this signal after the SSL handshake to indicate that one or more errors have occurred while establishing the identity of the peer. The errors are usually an indication that <a href="qwebsocketserver.html">QWebSocketServer</a> is unable to securely identify the peer. Unless any action is taken, the connection will be dropped after this signal has been emitted.</p>
<p><i>errors</i> contains one or more errors that prevent <a href="../qtnetwork/qsslsocket.html">QSslSocket</a> from verifying the identity of the peer.</p>
<p><b>See also </b><a href="qwebsocketserver.html#peerVerifyError">peerVerifyError</a>().</p>
<!-- @@@sslErrors -->
<!-- $$$supportedVersions[overload1]$$$supportedVersions -->
<h3 class="fn"><a name="supportedVersions"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qwebsocketprotocol.html#Version-enum">QWebSocketProtocol::Version</a></span>&gt; QWebSocketServer::<span class="name">supportedVersions</span>() const</h3>
<p>Returns a list of <a href="qml-qt-websockets-websocket.html">WebSocket</a> versions that this server is supporting.</p>
<!-- @@@supportedVersions -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2014 Digia Plc and/or its
   subsidiaries. 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>    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. </p>
</div>
</body>
</html>