Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > a6711891ce757817bba854bf3f25205a > files > 1899

qtjambi-doc-4.3.3-3mdv2008.1.i586.rpm

<class name="QAbstractSocket" doc="/**
&lt;p&gt;The &lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt; class provides the base functionality common to all socket types.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt; is the base class for &lt;a href=&quot;QTcpSocket.html&quot;&gt;&lt;tt&gt;QTcpSocket&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QUdpSocket.html&quot;&gt;&lt;tt&gt;QUdpSocket&lt;/tt&gt;&lt;/a&gt; and contains all common functionality of these two classes. If you need a socket, you have two options:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Instantiate &lt;a href=&quot;QTcpSocket.html&quot;&gt;&lt;tt&gt;QTcpSocket&lt;/tt&gt;&lt;/a&gt; or &lt;a href=&quot;QUdpSocket.html&quot;&gt;&lt;tt&gt;QUdpSocket&lt;/tt&gt;&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Create a native socket descriptor, instantiate &lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt;, and call &lt;a href=&quot;QAbstractSocket.html#setSocketDescriptor(int, com.trolltech.qt.network.QAbstractSocket.SocketState, com.trolltech.qt.core.QIODevice.OpenMode)&quot;&gt;&lt;tt&gt;setSocketDescriptor&lt;/tt&gt;&lt;/a&gt; to wrap the native socket.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;TCP (Transmission Control Protocol) is a reliable, stream-oriented, connection-oriented transport protocol. UDP (User Datagram Protocol) is an unreliable, datagram-oriented, connectionless protocol. In practice, this means that TCP is better suited for continuous transmission of data, whereas the more lightweight UDP can be used when reliability isn't important.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt;'s API unifies most of the differences between the two protocols. For example, although UDP is connectionless, connectToHost() establishes a virtual connection for UDP sockets, enabling you to use &lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt; in more or less the same way regardless of the underlying protocol. Internally, &lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt; remembers the address and port passed to connectToHost(), and functions like &lt;a href=&quot;%2E%2E/core/%2E%2E/core/QIODevice.html#read(long)&quot;&gt;&lt;tt&gt;read&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;%2E%2E/core/%2E%2E/core/QIODevice.html#write(com.trolltech.qt.core.QByteArray)&quot;&gt;&lt;tt&gt;write&lt;/tt&gt;&lt;/a&gt; use these values.&lt;/p&gt;
&lt;p&gt;At any time, &lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt; has a state (returned by &lt;a href=&quot;QAbstractSocket.html#state()&quot;&gt;&lt;tt&gt;state&lt;/tt&gt;&lt;/a&gt;). The initial state is &lt;a href=&quot;QAbstractSocket.html#SocketState-enum&quot;&gt;&lt;tt&gt;UnconnectedState&lt;/tt&gt;&lt;/a&gt;. After calling connectToHost(), the socket first enters &lt;a href=&quot;QAbstractSocket.html#SocketState-enum&quot;&gt;&lt;tt&gt;HostLookupState&lt;/tt&gt;&lt;/a&gt;. If the host is found, &lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt; enters &lt;a href=&quot;QAbstractSocket.html#SocketState-enum&quot;&gt;&lt;tt&gt;ConnectingState&lt;/tt&gt;&lt;/a&gt; and emits the &lt;a href=&quot;QAbstractSocket.html#hostFound()&quot;&gt;&lt;tt&gt;hostFound&lt;/tt&gt;&lt;/a&gt; signal. When the connection has been established, it enters &lt;a href=&quot;QAbstractSocket.html#SocketState-enum&quot;&gt;&lt;tt&gt;ConnectedState&lt;/tt&gt;&lt;/a&gt; and emits &lt;a href=&quot;QAbstractSocket.html#connected()&quot;&gt;&lt;tt&gt;connected&lt;/tt&gt;&lt;/a&gt;. If an error occurs at any stage, &lt;a href=&quot;QAbstractSocket.html#error()&quot;&gt;&lt;tt&gt;error&lt;/tt&gt;&lt;/a&gt; is emitted. Whenever the state changes, &lt;a href=&quot;QAbstractSocket.html#stateChanged(com.trolltech.qt.network.QAbstractSocket.SocketState)&quot;&gt;&lt;tt&gt;stateChanged&lt;/tt&gt;&lt;/a&gt; is emitted. For convenience, &lt;a href=&quot;QAbstractSocket.html#isValid()&quot;&gt;&lt;tt&gt;isValid&lt;/tt&gt;&lt;/a&gt; returns true if the socket is ready for reading and writing, but note that the socket's state must be &lt;a href=&quot;QAbstractSocket.html#SocketState-enum&quot;&gt;&lt;tt&gt;ConnectedState&lt;/tt&gt;&lt;/a&gt; before reading and writing can occur.&lt;/p&gt;
&lt;p&gt;Read or write data by calling &lt;a href=&quot;%2E%2E/core/%2E%2E/core/QIODevice.html#read(long)&quot;&gt;&lt;tt&gt;read&lt;/tt&gt;&lt;/a&gt; or &lt;a href=&quot;%2E%2E/core/%2E%2E/core/QIODevice.html#write(com.trolltech.qt.core.QByteArray)&quot;&gt;&lt;tt&gt;write&lt;/tt&gt;&lt;/a&gt;, or use the convenience functions &lt;a href=&quot;%2E%2E/core/%2E%2E/core/QIODevice.html#readLine(long)&quot;&gt;&lt;tt&gt;readLine&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;%2E%2E/core/%2E%2E/core/QIODevice.html#readAll()&quot;&gt;&lt;tt&gt;readAll&lt;/tt&gt;&lt;/a&gt;. &lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt; also inherits getChar(), putChar(), and ungetChar() from &lt;a href=&quot;%2E%2E/core/%2E%2E/core/QIODevice.html#QIODevice(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QIODevice&lt;/tt&gt;&lt;/a&gt;, which work on single bytes. For every chunk of data that has been written to the socket, the &lt;a href=&quot;QAbstractSocket.html#bytesWritten(long)&quot;&gt;&lt;tt&gt;bytesWritten&lt;/tt&gt;&lt;/a&gt; signal is emitted.&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;QAbstractSocket.html#readyRead()&quot;&gt;&lt;tt&gt;readyRead&lt;/tt&gt;&lt;/a&gt; signal is emitted every time a new chunk of data has arrived. &lt;a href=&quot;QAbstractSocket.html#bytesAvailable()&quot;&gt;&lt;tt&gt;bytesAvailable&lt;/tt&gt;&lt;/a&gt; then returns the number of bytes that are available for reading. Typically, you would connect the &lt;a href=&quot;QAbstractSocket.html#readyRead()&quot;&gt;&lt;tt&gt;readyRead&lt;/tt&gt;&lt;/a&gt; signal to a slot and read all available data there. If you don't read all the data at once, the remaining data will still be available later, and any new incoming data will be appended to &lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt;'s internal read buffer. To limit the size of the read buffer, call &lt;a href=&quot;QAbstractSocket.html#setReadBufferSize(long)&quot;&gt;&lt;tt&gt;setReadBufferSize&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To close the socket, call &lt;a href=&quot;QAbstractSocket.html#disconnectFromHost()&quot;&gt;&lt;tt&gt;disconnectFromHost&lt;/tt&gt;&lt;/a&gt;. &lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt; enters QAbstractSocket::ClosingState, then emits closing(). After all pending data has been written to the socket, &lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt; actually closes the socket, enters QAbstractSocket::ClosedState, and emits &lt;a href=&quot;QAbstractSocket.html#disconnected()&quot;&gt;&lt;tt&gt;disconnected&lt;/tt&gt;&lt;/a&gt;. If you want to abort a connection immediately, discarding all pending data, call &lt;a href=&quot;QAbstractSocket.html#abort()&quot;&gt;&lt;tt&gt;abort&lt;/tt&gt;&lt;/a&gt; instead. If the remote host closes the connection, &lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt; will emit error(QAbstractSocket::RemoteHostClosedError), during which the socket state will still be &lt;a href=&quot;QAbstractSocket.html#SocketState-enum&quot;&gt;&lt;tt&gt;ConnectedState&lt;/tt&gt;&lt;/a&gt;, and then the &lt;a href=&quot;QAbstractSocket.html#disconnected()&quot;&gt;&lt;tt&gt;disconnected&lt;/tt&gt;&lt;/a&gt; signal will be emitted.&lt;/p&gt;
&lt;p&gt;The port and address of the connected peer is fetched by calling peerPort() and &lt;a href=&quot;QAbstractSocket.html#peerAddress()&quot;&gt;&lt;tt&gt;peerAddress&lt;/tt&gt;&lt;/a&gt;. &lt;a href=&quot;QAbstractSocket.html#peerName()&quot;&gt;&lt;tt&gt;peerName&lt;/tt&gt;&lt;/a&gt; returns the host name of the peer, as passed to connectToHost(). localPort() and &lt;a href=&quot;QAbstractSocket.html#localAddress()&quot;&gt;&lt;tt&gt;localAddress&lt;/tt&gt;&lt;/a&gt; return the port and address of the local socket.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt; provides a set of functions that suspend the calling thread until certain signals are emitted. These functions can be used to implement blocking sockets:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;QAbstractSocket.html#waitForConnected(int)&quot;&gt;&lt;tt&gt;waitForConnected&lt;/tt&gt;&lt;/a&gt; blocks until a connection has been established.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;QAbstractSocket.html#waitForReadyRead(int)&quot;&gt;&lt;tt&gt;waitForReadyRead&lt;/tt&gt;&lt;/a&gt; blocks until new data is available for reading.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;QAbstractSocket.html#waitForBytesWritten(int)&quot;&gt;&lt;tt&gt;waitForBytesWritten&lt;/tt&gt;&lt;/a&gt; blocks until one payload of data has been written to the socket.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;QAbstractSocket.html#waitForDisconnected(int)&quot;&gt;&lt;tt&gt;waitForDisconnected&lt;/tt&gt;&lt;/a&gt; blocks until the connection has closed.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We show an example:&lt;/p&gt;
&lt;pre&gt;        int numRead = 0, numReadTotal = 0;
        char buffer[50];

        forever {
            numRead  = socket.read(buffer, 50);

            &lt;span class=&quot;comment&quot;&gt;// do whatever with array&lt;/span&gt;

            numReadTotal += numRead;
            if (numRead == 0 &amp;amp;&amp;amp; !socket.waitForReadyRead())
                break;
        }&lt;/pre&gt;
&lt;p&gt;If waitForReadyRead() returns false, the connection has been closed or an error has occurred.&lt;/p&gt;
&lt;p&gt;Programming with a blocking socket is radically different from programming with a non-blocking socket. A blocking socket doesn't require an event loop and typically leads to simpler code. However, in a GUI application, blocking sockets should only be used in non-GUI threads, to avoid freezing the user interface. See the network/fortuneclient&lt;/tt&gt; and network/blockingfortuneclient&lt;/tt&gt; examples for an overview of both approaches.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt; can be used with &lt;a href=&quot;%2E%2E/core/QTextStream.html&quot;&gt;&lt;tt&gt;QTextStream&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;%2E%2E/core/QDataStream.html&quot;&gt;&lt;tt&gt;QDataStream&lt;/tt&gt;&lt;/a&gt;'s stream operators (operator&amp;lt;&amp;lt;() and operator&amp;gt;&amp;gt;()). There is one issue to be aware of, though: You must make sure that enough data is available before attempting to read it using operator&amp;gt;&amp;gt;().&lt;/p&gt;

@see &lt;a href=&quot;QFtp.html&quot;&gt;&lt;tt&gt;QFtp&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html&quot;&gt;&lt;tt&gt;QHttp&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTcpServer.html&quot;&gt;&lt;tt&gt;QTcpServer&lt;/tt&gt;&lt;/a&gt; */">
    <signal name="protected final void aboutToClose()" doc="/**
&lt;p&gt;This signal is emitted when the device is about to close. Connect this signal if you have operations that need to be performed before the device closes (e.g&amp;#x2e;, if you have data in a separate buffer that needs to be written to the device).&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signature:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <signal name="protected final void bytesWritten(long bytes)" doc="/**
&lt;p&gt;This signal is emitted every time a payload of data has been written to the device. The &lt;tt&gt;bytes&lt;/tt&gt; argument is set to the number of bytes that were written in this payload.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;QAbstractSocket.html#bytesWritten(long)&quot;&gt;&lt;tt&gt;bytesWritten&lt;/tt&gt;&lt;/a&gt; is not emitted recursively; if you reenter the event loop or call &lt;a href=&quot;QAbstractSocket.html#waitForBytesWritten(int)&quot;&gt;&lt;tt&gt;waitForBytesWritten&lt;/tt&gt;&lt;/a&gt; inside a slot connected to the &lt;a href=&quot;QAbstractSocket.html#bytesWritten(long)&quot;&gt;&lt;tt&gt;bytesWritten&lt;/tt&gt;&lt;/a&gt; signal, the signal will not be reemitted (although &lt;a href=&quot;QAbstractSocket.html#waitForBytesWritten(int)&quot;&gt;&lt;tt&gt;waitForBytesWritten&lt;/tt&gt;&lt;/a&gt; may still return true).&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(long bytes)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;QAbstractSocket.html#readyRead()&quot;&gt;&lt;tt&gt;readyRead&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <signal name="protected final void connected()" doc="/**
&lt;p&gt;This signal is emitted after connectToHost() has been called and a connection has been successfully established.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signature:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;connectToHost&lt;/tt&gt;, &lt;a href=&quot;QAbstractSocket.html#disconnected()&quot;&gt;&lt;tt&gt;disconnected&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <signal name="protected final void disconnected()" doc="/**
&lt;p&gt;This signal is emitted when the socket has been disconnected.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signature:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;connectToHost&lt;/tt&gt;, &lt;a href=&quot;QAbstractSocket.html#disconnectFromHost()&quot;&gt;&lt;tt&gt;disconnectFromHost&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QAbstractSocket.html#abort()&quot;&gt;&lt;tt&gt;abort&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <signal name="protected final void error(com.trolltech.qt.network.QAbstractSocket.SocketError arg__1)" doc="/**
&lt;p&gt;This signal is emitted after an error occurred. The &lt;tt&gt;arg__1&lt;/tt&gt; parameter describes the type of error that occurred.&lt;/p&gt;
&lt;p&gt;QAbstractSocket::SocketError is not a registered metatype, so for queued connections, you will have to register it with Q_REGISTER_METATYPE.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(com.trolltech.qt.network.QAbstractSocket.SocketError arg__1)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;QAbstractSocket.html#error()&quot;&gt;&lt;tt&gt;error&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;%2E%2E/core/%2E%2E/core/QIODevice.html#errorString()&quot;&gt;&lt;tt&gt;errorString&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <signal name="protected final void hostFound()" doc="/**
&lt;p&gt;This signal is emitted after connectToHost() has been called and the host lookup has succeeded.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signature:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;QAbstractSocket.html#connected()&quot;&gt;&lt;tt&gt;connected&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <signal name="protected final void proxyAuthenticationRequiredPrivate(com.trolltech.qt.network.QNetworkProxy proxy, com.trolltech.qt.network.QAuthenticator authenticator)" doc="/**
&lt;p&gt;This signal can be emitted when a &lt;tt&gt;proxy&lt;/tt&gt; that requires authentication is used. The &lt;tt&gt;authenticator&lt;/tt&gt; object can then be filled in with the required details to allow authentication and continue the connection.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; It is not possible to use a QueuedConnection to connect to this signal, as the connection will fail if the authenticator has not been filled in with new information when the signal returns.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(com.trolltech.qt.network.QNetworkProxy proxy, com.trolltech.qt.network.QAuthenticator authenticator)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(com.trolltech.qt.network.QNetworkProxy proxy)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;QAuthenticator.html&quot;&gt;&lt;tt&gt;QAuthenticator&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QNetworkProxy.html&quot;&gt;&lt;tt&gt;QNetworkProxy&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <signal name="protected final void readyRead()" doc="/**
&lt;p&gt;This signal is emitted once every time new data is available for reading from the device. It will only be emitted again once new data is available, such as when a new payload of network data has arrived on your network socket, or when a new block of data has been appended to your device.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;QAbstractSocket.html#readyRead()&quot;&gt;&lt;tt&gt;readyRead&lt;/tt&gt;&lt;/a&gt; is not emitted recursively; if you reenter the event loop or call &lt;a href=&quot;QAbstractSocket.html#waitForReadyRead(int)&quot;&gt;&lt;tt&gt;waitForReadyRead&lt;/tt&gt;&lt;/a&gt; inside a slot connected to the &lt;a href=&quot;QAbstractSocket.html#readyRead()&quot;&gt;&lt;tt&gt;readyRead&lt;/tt&gt;&lt;/a&gt; signal, the signal will not be reemitted (although &lt;a href=&quot;QAbstractSocket.html#waitForReadyRead(int)&quot;&gt;&lt;tt&gt;waitForReadyRead&lt;/tt&gt;&lt;/a&gt; may still return true).&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signature:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;QAbstractSocket.html#bytesWritten(long)&quot;&gt;&lt;tt&gt;bytesWritten&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <signal name="protected final void stateChanged(com.trolltech.qt.network.QAbstractSocket.SocketState arg__1)" doc="/**
&lt;p&gt;This signal is emitted whenever &lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt;'s state changes. The &lt;tt&gt;arg__1&lt;/tt&gt; parameter is the new state.&lt;/p&gt;
&lt;p&gt;QAbstractSocket::SocketState is not a registered metatype, so for queued connections, you will have to register it with Q_REGISTER_METATYPE.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(com.trolltech.qt.network.QAbstractSocket.SocketState arg__1)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;QAbstractSocket.html#state()&quot;&gt;&lt;tt&gt;state&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <method name="public QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType socketType, com.trolltech.qt.core.QObject parent)" doc="/**
&lt;p&gt;Creates a new abstract socket of type &lt;tt&gt;socketType&lt;/tt&gt;. The &lt;tt&gt;parent&lt;/tt&gt; argument is passed to &lt;a href=&quot;%2E%2E/core/%2E%2E/core/QObject.html#QObject(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QObject&lt;/tt&gt;&lt;/a&gt;'s constructor.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractSocket.html#socketType()&quot;&gt;&lt;tt&gt;socketType&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTcpSocket.html&quot;&gt;&lt;tt&gt;QTcpSocket&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QUdpSocket.html&quot;&gt;&lt;tt&gt;QUdpSocket&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void abort()" doc="/**
&lt;p&gt;Aborts the current connection and resets the socket. Unlike &lt;a href=&quot;QAbstractSocket.html#disconnectFromHost()&quot;&gt;&lt;tt&gt;disconnectFromHost&lt;/tt&gt;&lt;/a&gt;, this function immediately closes the socket, clearing any pending data in the write buffer.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractSocket.html#disconnectFromHost()&quot;&gt;&lt;tt&gt;disconnectFromHost&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QAbstractSocket.html#close()&quot;&gt;&lt;tt&gt;close&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void disconnectFromHost()" doc="/**
&lt;p&gt;Attempts to close the socket. If there is pending data waiting to be written, &lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt; will enter &lt;a href=&quot;QAbstractSocket.html#SocketState-enum&quot;&gt;&lt;tt&gt;ClosingState&lt;/tt&gt;&lt;/a&gt; and wait until all data has been written. Eventually, it will enter &lt;a href=&quot;QAbstractSocket.html#SocketState-enum&quot;&gt;&lt;tt&gt;UnconnectedState&lt;/tt&gt;&lt;/a&gt; and emit the &lt;a href=&quot;QAbstractSocket.html#disconnected()&quot;&gt;&lt;tt&gt;disconnected&lt;/tt&gt;&lt;/a&gt; signal.&lt;/p&gt;

@see &lt;tt&gt;connectToHost&lt;/tt&gt; */"/>
    <method name="protected final void disconnectFromHostImplementation()" doc="/**
&lt;p&gt;Contains the implementation of &lt;a href=&quot;QAbstractSocket.html#disconnectFromHost()&quot;&gt;&lt;tt&gt;disconnectFromHost&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
 */"/>
    <method name="public final com.trolltech.qt.network.QAbstractSocket.SocketError error()" doc="/**
&lt;p&gt;Returns the type of error that last occurred.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractSocket.html#state()&quot;&gt;&lt;tt&gt;state&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;%2E%2E/core/%2E%2E/core/QIODevice.html#errorString()&quot;&gt;&lt;tt&gt;errorString&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final boolean flush()" doc="/**
&lt;p&gt;This function writes as much as possible from the internal write buffer to the underlying network socket, without blocking. If any data was written, this function returns true; otherwise false is returned.&lt;/p&gt;
&lt;p&gt;Call this function if you need &lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt; to start sending buffered data immediately. The number of bytes successfully written depends on the operating system. In most cases, you do not need to call this function, because &lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt; will start sending data automatically once control goes back to the event loop. In the absence of an event loop, call &lt;a href=&quot;QAbstractSocket.html#waitForBytesWritten(int)&quot;&gt;&lt;tt&gt;waitForBytesWritten&lt;/tt&gt;&lt;/a&gt; instead.&lt;/p&gt;

@see &lt;a href=&quot;%2E%2E/core/%2E%2E/core/QIODevice.html#write(com.trolltech.qt.core.QByteArray)&quot;&gt;&lt;tt&gt;write&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QAbstractSocket.html#waitForBytesWritten(int)&quot;&gt;&lt;tt&gt;waitForBytesWritten&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final boolean isValid()" doc="/**
&lt;p&gt;Returns true if the socket is valid and ready for use; otherwise returns false.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; The socket's state must be &lt;a href=&quot;QAbstractSocket.html#SocketState-enum&quot;&gt;&lt;tt&gt;ConnectedState&lt;/tt&gt;&lt;/a&gt; before reading and writing can occur.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractSocket.html#state()&quot;&gt;&lt;tt&gt;state&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.network.QHostAddress localAddress()" doc="/**
&lt;p&gt;Returns the host address of the local socket if available; otherwise returns QHostAddress::Null.&lt;/p&gt;
&lt;p&gt;This is normally the main IP address of the host, but can be QHostAddress::LocalHost (127.0&amp;#x2e;0&amp;#x2e;1) for connections to the local host.&lt;/p&gt;

@see &lt;tt&gt;localPort&lt;/tt&gt;
@see &lt;a href=&quot;QAbstractSocket.html#peerAddress()&quot;&gt;&lt;tt&gt;peerAddress&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QAbstractSocket.html#setLocalAddress(com.trolltech.qt.network.QHostAddress)&quot;&gt;&lt;tt&gt;setLocalAddress&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.network.QHostAddress peerAddress()" doc="/**
&lt;p&gt;Returns the address of the connected peer if the socket is in &lt;a href=&quot;QAbstractSocket.html#SocketState-enum&quot;&gt;&lt;tt&gt;ConnectedState&lt;/tt&gt;&lt;/a&gt;; otherwise returns QHostAddress::Null.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractSocket.html#peerName()&quot;&gt;&lt;tt&gt;peerName&lt;/tt&gt;&lt;/a&gt;
@see &lt;tt&gt;peerPort&lt;/tt&gt;
@see &lt;a href=&quot;QAbstractSocket.html#localAddress()&quot;&gt;&lt;tt&gt;localAddress&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QAbstractSocket.html#setPeerAddress(com.trolltech.qt.network.QHostAddress)&quot;&gt;&lt;tt&gt;setPeerAddress&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final java.lang.String peerName()" doc="/**
&lt;p&gt;Returns the name of the peer as specified by connectToHost(), or an empty &lt;a href=&quot;%2E%2E/porting4.html#qstring&quot;&gt;&lt;tt&gt;QString&lt;/tt&gt;&lt;/a&gt; if connectToHost() has not been called.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractSocket.html#peerAddress()&quot;&gt;&lt;tt&gt;peerAddress&lt;/tt&gt;&lt;/a&gt;
@see &lt;tt&gt;peerPort&lt;/tt&gt;
@see &lt;a href=&quot;QAbstractSocket.html#setPeerName(java.lang.String)&quot;&gt;&lt;tt&gt;setPeerName&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.network.QNetworkProxy proxy()" doc="/**
&lt;p&gt;Returns the network proxy for this socket. By default QNetworkProxy::DefaultProxy is used.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractSocket.html#setProxy(com.trolltech.qt.network.QNetworkProxy)&quot;&gt;&lt;tt&gt;setProxy&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QNetworkProxy.html&quot;&gt;&lt;tt&gt;QNetworkProxy&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final long readBufferSize()" doc="/**
&lt;p&gt;Returns the size of the internal read buffer. This limits the amount of data that the client can receive before you call &lt;a href=&quot;%2E%2E/core/%2E%2E/core/QIODevice.html#read(long)&quot;&gt;&lt;tt&gt;read&lt;/tt&gt;&lt;/a&gt; or &lt;a href=&quot;%2E%2E/core/%2E%2E/core/QIODevice.html#readAll()&quot;&gt;&lt;tt&gt;readAll&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;A read buffer size of 0 (the default) means that the buffer has no size limit, ensuring that no data is lost.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractSocket.html#setReadBufferSize(long)&quot;&gt;&lt;tt&gt;setReadBufferSize&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;%2E%2E/core/%2E%2E/core/QIODevice.html#read(long)&quot;&gt;&lt;tt&gt;read&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="protected final void setLocalAddress(com.trolltech.qt.network.QHostAddress address)" doc="/**
&lt;p&gt;Sets the address on the local side of a connection to &lt;tt&gt;address&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;You can call this function in a subclass of &lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt; to change the return value of the &lt;a href=&quot;QAbstractSocket.html#localAddress()&quot;&gt;&lt;tt&gt;localAddress&lt;/tt&gt;&lt;/a&gt; function after a connection has been established. This feature is commonly used by proxy connections for virtual connection settings.&lt;/p&gt;
&lt;p&gt;Note that this function does not bind the local address of the socket prior to a connection (e.g&amp;#x2e;, QUdpSocket::bind()).&lt;/p&gt;

@see &lt;a href=&quot;QAbstractSocket.html#localAddress()&quot;&gt;&lt;tt&gt;localAddress&lt;/tt&gt;&lt;/a&gt;
@see &lt;tt&gt;setLocalPort&lt;/tt&gt;
@see &lt;a href=&quot;QAbstractSocket.html#setPeerAddress(com.trolltech.qt.network.QHostAddress)&quot;&gt;&lt;tt&gt;setPeerAddress&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="protected final void setPeerAddress(com.trolltech.qt.network.QHostAddress address)" doc="/**
&lt;p&gt;Sets the address of the remote side of the connection to &lt;tt&gt;address&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;You can call this function in a subclass of &lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt; to change the return value of the &lt;a href=&quot;QAbstractSocket.html#peerAddress()&quot;&gt;&lt;tt&gt;peerAddress&lt;/tt&gt;&lt;/a&gt; function after a connection has been established. This feature is commonly used by proxy connections for virtual connection settings.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractSocket.html#peerAddress()&quot;&gt;&lt;tt&gt;peerAddress&lt;/tt&gt;&lt;/a&gt;
@see &lt;tt&gt;setPeerPort&lt;/tt&gt;
@see &lt;a href=&quot;QAbstractSocket.html#setLocalAddress(com.trolltech.qt.network.QHostAddress)&quot;&gt;&lt;tt&gt;setLocalAddress&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="protected final void setPeerName(java.lang.String name)" doc="/**
&lt;p&gt;Sets the host name of the remote peer to &lt;tt&gt;name&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;You can call this function in a subclass of &lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt; to change the return value of the &lt;a href=&quot;QAbstractSocket.html#peerName()&quot;&gt;&lt;tt&gt;peerName&lt;/tt&gt;&lt;/a&gt; function after a connection has been established. This feature is commonly used by proxy connections for virtual connection settings.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractSocket.html#peerName()&quot;&gt;&lt;tt&gt;peerName&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void setProxy(com.trolltech.qt.network.QNetworkProxy networkProxy)" doc="/**
&lt;p&gt;Sets the explicit network proxy for this socket to &lt;tt&gt;networkProxy&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;To disable the use of a proxy for this socket, use the QNetworkProxy::NoProxy proxy type:&lt;/p&gt;
&lt;pre&gt;    socket-&amp;gt;setProxy(QNetworkProxy::NoProxy);&lt;/pre&gt;

@see &lt;a href=&quot;QAbstractSocket.html#proxy()&quot;&gt;&lt;tt&gt;proxy&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QNetworkProxy.html&quot;&gt;&lt;tt&gt;QNetworkProxy&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void setReadBufferSize(long size)" doc="/**
&lt;p&gt;Sets the size of &lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt;'s internal read buffer to be &lt;tt&gt;size&lt;/tt&gt; bytes.&lt;/p&gt;
&lt;p&gt;If the buffer size is limited to a certain size, &lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt; won't buffer more than this size of data. Exceptionally, a buffer size of 0 means that the read buffer is unlimited and all incoming data is buffered. This is the default.&lt;/p&gt;
&lt;p&gt;This option is useful if you only read the data at certain points in time (e.g&amp;#x2e;, in a real-time streaming application) or if you want to protect your socket against receiving too much data, which may eventually cause your application to run out of memory.&lt;/p&gt;
&lt;p&gt;Only &lt;a href=&quot;QTcpSocket.html&quot;&gt;&lt;tt&gt;QTcpSocket&lt;/tt&gt;&lt;/a&gt; uses &lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt;'s internal buffer; &lt;a href=&quot;QUdpSocket.html&quot;&gt;&lt;tt&gt;QUdpSocket&lt;/tt&gt;&lt;/a&gt; does not use any buffering at all, but rather relies on the implicit buffering provided by the operating system. Because of this, calling this function on &lt;a href=&quot;QUdpSocket.html&quot;&gt;&lt;tt&gt;QUdpSocket&lt;/tt&gt;&lt;/a&gt; has no effect.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractSocket.html#readBufferSize()&quot;&gt;&lt;tt&gt;readBufferSize&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;%2E%2E/core/%2E%2E/core/QIODevice.html#read(long)&quot;&gt;&lt;tt&gt;read&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final boolean setSocketDescriptor(int socketDescriptor, com.trolltech.qt.network.QAbstractSocket.SocketState state, com.trolltech.qt.core.QIODevice.OpenMode openMode)" doc="/**
&lt;p&gt;Initializes &lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt; with the native socket descriptor &lt;tt&gt;socketDescriptor&lt;/tt&gt;. Returns true if &lt;tt&gt;socketDescriptor&lt;/tt&gt; is accepted as a valid socket descriptor; otherwise returns false. The socket is opened in the mode specified by &lt;tt&gt;openMode&lt;/tt&gt;, and enters the socket state specified by &lt;tt&gt;state&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; It is not possible to initialize two abstract sockets with the same native socket descriptor.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractSocket.html#socketDescriptor()&quot;&gt;&lt;tt&gt;socketDescriptor&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final boolean setSocketDescriptor(int socketDescriptor, com.trolltech.qt.network.QAbstractSocket.SocketState state)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QAbstractSocket.html#setSocketDescriptor(int, com.trolltech.qt.network.QAbstractSocket.SocketState, com.trolltech.qt.core.QIODevice.OpenMode)&quot;&gt;&lt;tt&gt;setSocketDescriptor&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;socketDescriptor&lt;/tt&gt;, &lt;tt&gt;state&lt;/tt&gt;, ReadWrite). */"/>
    <method name="public final boolean setSocketDescriptor(int socketDescriptor)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QAbstractSocket.html#setSocketDescriptor(int, com.trolltech.qt.network.QAbstractSocket.SocketState, com.trolltech.qt.core.QIODevice.OpenMode)&quot;&gt;&lt;tt&gt;setSocketDescriptor&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;socketDescriptor&lt;/tt&gt;, ConnectedState, ReadWrite). */"/>
    <method name="protected final void setSocketError(com.trolltech.qt.network.QAbstractSocket.SocketError socketError)" doc="/**
&lt;p&gt;Sets the type of error that last occurred to &lt;tt&gt;socketError&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractSocket.html#setSocketState(com.trolltech.qt.network.QAbstractSocket.SocketState)&quot;&gt;&lt;tt&gt;setSocketState&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;%2E%2E/core/%2E%2E/core/QIODevice.html#setErrorString(java.lang.String)&quot;&gt;&lt;tt&gt;setErrorString&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="protected final void setSocketState(com.trolltech.qt.network.QAbstractSocket.SocketState state)" doc="/**
&lt;p&gt;Sets the state of the socket to &lt;tt&gt;state&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractSocket.html#state()&quot;&gt;&lt;tt&gt;state&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final int socketDescriptor()" doc="/**
&lt;p&gt;Returns the native socket descriptor of the &lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt; object if this is available; otherwise returns -1.&lt;/p&gt;
&lt;p&gt;If the socket is using &lt;a href=&quot;QNetworkProxy.html&quot;&gt;&lt;tt&gt;QNetworkProxy&lt;/tt&gt;&lt;/a&gt;, the returned descriptor may not be usable with native socket functions.&lt;/p&gt;
&lt;p&gt;The socket descriptor is not available when &lt;a href=&quot;QAbstractSocket.html#QAbstractSocket(com.trolltech.qt.network.QAbstractSocket.SocketType, com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractSocket&lt;/tt&gt;&lt;/a&gt; is in &lt;a href=&quot;QAbstractSocket.html#SocketState-enum&quot;&gt;&lt;tt&gt;UnconnectedState&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractSocket.html#setSocketDescriptor(int, com.trolltech.qt.network.QAbstractSocket.SocketState, com.trolltech.qt.core.QIODevice.OpenMode)&quot;&gt;&lt;tt&gt;setSocketDescriptor&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.network.QAbstractSocket.SocketType socketType()" doc="/**
&lt;p&gt;Returns the socket type (TCP, UDP, or other).&lt;/p&gt;

@see &lt;a href=&quot;QTcpSocket.html&quot;&gt;&lt;tt&gt;QTcpSocket&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QUdpSocket.html&quot;&gt;&lt;tt&gt;QUdpSocket&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.network.QAbstractSocket.SocketState state()" doc="/**
&lt;p&gt;Returns the state of the socket.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractSocket.html#error()&quot;&gt;&lt;tt&gt;error&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final boolean waitForConnected(int msecs)" doc="/**
&lt;p&gt;Waits until the socket is connected, up to &lt;tt&gt;msecs&lt;/tt&gt; milliseconds. If the connection has been established, this function returns true; otherwise it returns false. In the case where it returns false, you can call &lt;a href=&quot;QAbstractSocket.html#error()&quot;&gt;&lt;tt&gt;error&lt;/tt&gt;&lt;/a&gt; to determine the cause of the error.&lt;/p&gt;
&lt;p&gt;The following example waits up to one second for a connection to be established:&lt;/p&gt;
&lt;pre&gt;    socket-&amp;gt;connectToHost(&amp;quot;imap&amp;quot;, 143);
    if (socket-&amp;gt;waitForConnected(1000))
        qDebug(&amp;quot;Connected!&amp;quot;);&lt;/pre&gt;
&lt;p&gt;If msecs is -1, this function will not time out.&lt;/p&gt;

@see &lt;tt&gt;connectToHost&lt;/tt&gt;
@see &lt;a href=&quot;QAbstractSocket.html#connected()&quot;&gt;&lt;tt&gt;connected&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final boolean waitForConnected()" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QAbstractSocket.html#waitForConnected(int)&quot;&gt;&lt;tt&gt;waitForConnected&lt;/tt&gt;&lt;/a&gt;(30000). */"/>
    <method name="public final boolean waitForDisconnected(int msecs)" doc="/**
&lt;p&gt;Waits until the socket has disconnected, up to &lt;tt&gt;msecs&lt;/tt&gt; milliseconds. If the connection has been disconnected, this function returns true; otherwise it returns false. In the case where it returns false, you can call &lt;a href=&quot;QAbstractSocket.html#error()&quot;&gt;&lt;tt&gt;error&lt;/tt&gt;&lt;/a&gt; to determine the cause of the error.&lt;/p&gt;
&lt;p&gt;The following example waits up to one second for a connection to be closed:&lt;/p&gt;
&lt;pre&gt;    socket-&amp;gt;disconnectFromHost();
    if (socket-&amp;gt;waitForDisconnected(1000))
        qDebug(&amp;quot;Disconnected!&amp;quot;);&lt;/pre&gt;
&lt;p&gt;If msecs is -1, this function will not time out.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractSocket.html#disconnectFromHost()&quot;&gt;&lt;tt&gt;disconnectFromHost&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QAbstractSocket.html#close()&quot;&gt;&lt;tt&gt;close&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final boolean waitForDisconnected()" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QAbstractSocket.html#waitForDisconnected(int)&quot;&gt;&lt;tt&gt;waitForDisconnected&lt;/tt&gt;&lt;/a&gt;(30000). */"/>
    <method name="public boolean atEnd()" doc="/**
&lt;p&gt;This function is reimplemented for internal reasons.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractSocket.html#bytesAvailable()&quot;&gt;&lt;tt&gt;bytesAvailable&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QAbstractSocket.html#readyRead()&quot;&gt;&lt;tt&gt;readyRead&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public long bytesAvailable()" doc="/**
&lt;p&gt;Returns the number of incoming bytes that are waiting to be read.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractSocket.html#bytesToWrite()&quot;&gt;&lt;tt&gt;bytesToWrite&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;%2E%2E/core/%2E%2E/core/QIODevice.html#read(long)&quot;&gt;&lt;tt&gt;read&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public long bytesToWrite()" doc="/**
&lt;p&gt;Returns the number of bytes that are waiting to be written. The bytes are written when control goes back to the event loop or when &lt;a href=&quot;QAbstractSocket.html#flush()&quot;&gt;&lt;tt&gt;flush&lt;/tt&gt;&lt;/a&gt; is called.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractSocket.html#bytesAvailable()&quot;&gt;&lt;tt&gt;bytesAvailable&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QAbstractSocket.html#flush()&quot;&gt;&lt;tt&gt;flush&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public boolean canReadLine()" doc="/**
&lt;p&gt;Returns true if a line of data can be read from the socket; otherwise returns false.&lt;/p&gt;

@see &lt;a href=&quot;%2E%2E/core/%2E%2E/core/QIODevice.html#readLine(long)&quot;&gt;&lt;tt&gt;readLine&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public void close()" doc="/**
&lt;p&gt;Disconnects the socket's connection with the host.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractSocket.html#abort()&quot;&gt;&lt;tt&gt;abort&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public boolean isSequential()" doc="/**
&lt;p&gt;This function is reimplemented for internal reasons.&lt;/p&gt;
 */"/>
    <method name="protected int readData(byte[] data)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QAbstractSocket.html#readData(byte[])&quot;&gt;&lt;tt&gt;readData&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;data&lt;/tt&gt;, ). */"/>
    <method name="protected int readLineData(byte[] data)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QAbstractSocket.html#readLineData(byte[])&quot;&gt;&lt;tt&gt;readLineData&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;data&lt;/tt&gt;, ). */"/>
    <method name="public boolean waitForBytesWritten(int msecs)" doc="/**
&lt;p&gt;This function is reimplemented for internal reasons.&lt;/p&gt;
 */"/>
    <method name="public final boolean waitForBytesWritten()" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QAbstractSocket.html#waitForBytesWritten(int)&quot;&gt;&lt;tt&gt;waitForBytesWritten&lt;/tt&gt;&lt;/a&gt;(30000). */"/>
    <method name="public boolean waitForReadyRead(int msecs)" doc="/**
&lt;p&gt;This function blocks until data is available for reading and the readyRead() signal has been emitted. The function will timeout after &lt;tt&gt;msecs&lt;/tt&gt; milliseconds; the default timeout is 3000 milliseconds.&lt;/p&gt;
&lt;p&gt;The function returns true if data is available for reading; otherwise it returns false (if an error occurred or the operation timed out).&lt;/p&gt;

@see &lt;a href=&quot;QAbstractSocket.html#waitForBytesWritten(int)&quot;&gt;&lt;tt&gt;waitForBytesWritten&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final boolean waitForReadyRead()" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QAbstractSocket.html#waitForReadyRead(int)&quot;&gt;&lt;tt&gt;waitForReadyRead&lt;/tt&gt;&lt;/a&gt;(30000). */"/>
    <method name="protected int writeData(byte[] data)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QAbstractSocket.html#writeData(byte[])&quot;&gt;&lt;tt&gt;writeData&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;data&lt;/tt&gt;, ). */"/>
    <enum name="SocketType" doc="/**
&lt;p&gt;This enum describes the transport layer protocol.&lt;/p&gt;

@see &lt;tt&gt;QAbstractSocket::socketType&lt;/tt&gt; */">
        <enum-value name="TcpSocket" doc="/**
&lt;p&gt;TCP&lt;/p&gt;
 */"/>
        <enum-value name="UdpSocket" doc="/**
&lt;p&gt;UDP&lt;/p&gt;
 */"/>
        <enum-value name="UnknownSocketType" doc="/**
&lt;p&gt;Other than TCP and UDP&lt;/p&gt;
 */"/>
</enum>
    <enum name="SocketError" doc="/**
&lt;p&gt;This enum describes the socket errors that can occur.&lt;/p&gt;
&lt;p&gt;Used by QAbstractSocketEngine only, this error indicates that the last operation could not complete.&lt;/p&gt;

@see &lt;tt&gt;QAbstractSocket::error&lt;/tt&gt; */">
        <enum-value name="ConnectionRefusedError" doc="/**
&lt;p&gt;The connection was refused by the peer (or timed out).&lt;/p&gt;
 */"/>
        <enum-value name="RemoteHostClosedError" doc="/**
&lt;p&gt;The remote host closed the connection. Note that the client socket (i.e&amp;#x2e;, this socket) will be closed after the remote close notification has been sent.&lt;/p&gt;
 */"/>
        <enum-value name="HostNotFoundError" doc="/**
&lt;p&gt;The host address was not found.&lt;/p&gt;
 */"/>
        <enum-value name="SocketAccessError" doc="/**
&lt;p&gt;The socket operation failed because the application lacked the required privileges.&lt;/p&gt;
 */"/>
        <enum-value name="SocketResourceError" doc="/**
&lt;p&gt;The local system ran out of resources (e.g&amp;#x2e;, too many sockets).&lt;/p&gt;
 */"/>
        <enum-value name="SocketTimeoutError" doc="/**
&lt;p&gt;The socket operation timed out.&lt;/p&gt;
 */"/>
        <enum-value name="DatagramTooLargeError" doc="/**
&lt;p&gt;The datagram was larger than the operating system's limit (which can be as low as 8192 bytes).&lt;/p&gt;
 */"/>
        <enum-value name="NetworkError" doc="/**
&lt;p&gt;An error occurred with the network (e.g&amp;#x2e;, the network cable was accidentally plugged out).&lt;/p&gt;
 */"/>
        <enum-value name="AddressInUseError" doc="/**
&lt;p&gt;The address specified to QUdpSocket::bind() is already in use and was set to be exclusive.&lt;/p&gt;
 */"/>
        <enum-value name="SocketAddressNotAvailableError" doc="/**
&lt;p&gt;The address specified to QUdpSocket::bind() does not belong to the host.&lt;/p&gt;
 */"/>
        <enum-value name="UnsupportedSocketOperationError" doc="/**
&lt;p&gt;The requested socket operation is not supported by the local operating system (e.g&amp;#x2e;, lack of IPv6 support).&lt;/p&gt;
 */"/>
        <enum-value name="UnfinishedSocketOperationError" doc="/**
Internal. */"/>
        <enum-value name="ProxyAuthenticationRequiredError" doc="/**
&lt;p&gt;The socket is using a proxy, and the proxy requires authentication.&lt;/p&gt;
 */"/>
        <enum-value name="UnknownSocketError" doc="/**
&lt;p&gt;An unidentified error occurred.&lt;/p&gt;
 */"/>
</enum>
    <enum name="NetworkLayerProtocol" doc="/**
&lt;p&gt;This enum describes the network layer protocol values used in Qt.&lt;/p&gt;

@see &lt;tt&gt;QHostAddress::protocol&lt;/tt&gt; */">
        <enum-value name="IPv4Protocol" doc="/**
&lt;p&gt;IPv4&lt;/p&gt;
 */"/>
        <enum-value name="IPv6Protocol" doc="/**
&lt;p&gt;IPv6&lt;/p&gt;
 */"/>
        <enum-value name="UnknownNetworkLayerProtocol" doc="/**
&lt;p&gt;Other than IPv4 and IPv6&lt;/p&gt;
 */"/>
</enum>
    <enum name="SocketState" doc="/**
&lt;p&gt;This enum describes the different states in which a socket can be.&lt;/p&gt;

@see &lt;tt&gt;QAbstractSocket::state&lt;/tt&gt; */">
        <enum-value name="UnconnectedState" doc="/**
&lt;p&gt;The socket is not connected.&lt;/p&gt;
 */"/>
        <enum-value name="HostLookupState" doc="/**
&lt;p&gt;The socket is performing a host name lookup.&lt;/p&gt;
 */"/>
        <enum-value name="ConnectingState" doc="/**
&lt;p&gt;The socket has started establishing a connection.&lt;/p&gt;
 */"/>
        <enum-value name="ConnectedState" doc="/**
&lt;p&gt;A connection is established.&lt;/p&gt;
 */"/>
        <enum-value name="BoundState" doc="/**
&lt;p&gt;The socket is bound to an address and port (for servers).&lt;/p&gt;
 */"/>
        <enum-value name="ListeningState" doc="/**
&lt;p&gt;For internal use only.&lt;/p&gt;
 */"/>
        <enum-value name="ClosingState" doc="/**
&lt;p&gt;The socket is about to close (data may still be waiting to be written).&lt;/p&gt;
 */"/>
</enum>
</class>