QBluetoothAbstractSocket Class Reference
|
Constant | Value | Description |
---|---|---|
QBluetoothAbstractSocket::NoError | 0 | No error has occurred. |
QBluetoothAbstractSocket::AccessError | 1 | The client has inadequate permissions to access the socket. |
QBluetoothAbstractSocket::ResourceError | 2 | The kernel has run out of sockets. |
QBluetoothAbstractSocket::BindError | 3 | The socket could not be bound to a particular address. |
QBluetoothAbstractSocket::ConnectionRefused | 4 | The remote host has refused a connection. |
QBluetoothAbstractSocket::HostDownError | 5 | The remote host could not be contacted. |
QBluetoothAbstractSocket::NetworkError | 6 | A network error has occurred, e.g. device moved out of range. |
QBluetoothAbstractSocket::TimeoutError | 7 | Operation has timed out. |
QBluetoothAbstractSocket::RemoteHostClosedError | 8 | Remote host has closed the connection. |
QBluetoothAbstractSocket::BusyError | 9 | The system is busy. |
QBluetoothAbstractSocket::HostUnreachableError | 10 | The remote host could not be reached. |
QBluetoothAbstractSocket::UnsupportedOperationError | 11 | The operation is not supported. |
QBluetoothAbstractSocket::AddressInUseError | 12 | Address is currently in use. |
QBluetoothAbstractSocket::AddressNotAvailableError | 13 | Address is not available. |
QBluetoothAbstractSocket::UnknownError | 14 | Unknown error has occurred. |
State of the rfcomm socket.
Constant | Value | Description |
---|---|---|
QBluetoothAbstractSocket::UnconnectedState | 0 | The socket is not connected. |
QBluetoothAbstractSocket::ConnectingState | 1 | The socket is being connected. |
QBluetoothAbstractSocket::ConnectedState | 2 | The socket is connected. |
QBluetoothAbstractSocket::BoundState | 3 | The socket has been bound. |
QBluetoothAbstractSocket::ClosingState | 4 | The socket is being closed. |
Deconstructs a QBluetoothAbstractSocket. If the socket is in any state other than UnconnectedState, the current connection is aborted.
Aborts the current connection and resets the socket. Unlike disconnect(), this function immediately closes the socket, clearing any pending data in the write buffer.
See also disconnect() and close().
Returns the number of bytes that are waiting to be read.
Reimplemented from QIODevice.
See also bytesToWrite() and read().
Returns the number of bytes which are pending to be written.
Reimplemented from QIODevice.
See also bytesAvailable() and write().
Returns true if a line of data can be read from the socket; otherwise returns false.
Reimplemented from QIODevice.
See also readLine().
Closes the socket. Pending data will not be flushed first. The socket will be immediately closed.
Reimplemented from QIODevice.
See also abort() and disconnect().
This signal is emitted once the connect() has been called and the rfcomm socket has been successfully connected.
See also connect() and disconnected().
Attempts to close the socket. If there is pending data waiting to be written, the socket will enter ClosingState and wait until all data has been written. Eventually it will enter UnconnectedState and emit the disconnected() signal.
Returns true on successful completion of the request; otherwise returns false.
See also close().
This signal is emitted when the socket has been disconnected.
See also connect(), disconnect(), and abort().
Returns the last error that has occurred.
See also state().
This is an overloaded member function, provided for convenience.
This signal is emitted after an error occurred. The socketError parameter describes the type of error that has occurred.
See also error() and errorString().
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.
See also write() and waitForBytesWritten().
Returns the size of the internal read buffer. This limits the amount of data that the client can receive before you call read() or readAll().
A read buffer size of 0 (the default) means that the buffer has no size limit, ensuring that no data is lost.
See also setReadBufferSize() and read().
Sets the capacity of QBluetoothAbstractSocket's internal read buffer to be size bytes. If size is 0 the buffer has unlimited capacity. This is the default.
See also readBufferSize().
Initializes the QBluetoothAbstractSocket with the native descriptor socketDescriptor. The socket is put into the state and opened in openMode.
Returns true on successful completion of the request; otherwise returns false.
See also socketDescriptor().
Returns the socket descriptor for the socket if the socket is currently active (e.g. not in UnconnectedState). Otherwise returns -1.
See also setSocketDescriptor() and state().
Returns the state of the socket.
See also error().
This signal is emitted when the state of the socket has changed. The socketState parameter holds the new state.
See also state().
Waits until the socket is connected, up to msecs milliseconds. If the connection has been established, this function returns true; otherwise returns false. In the case where it returns false, you can call error() to determine the cause of the error.
This is a blocking function call. Its use is not advised in a single-threaded GUI application, since the whole application will stop responding until the function returns. waitForNewConnected() is mostly useful when there is no event loop available.
See also connect() and connected().
Waits until the socket is disconnected, up to msecs milliseconds. If the connection has been terminated, this function returns true; otherwise returns false. In the case where it returns false, you can call error() to determine the cause of the error.
This is a blocking function call. Its use is not advised in a single-threaded GUI application, since the whole application will stop responding until the function returns. waitForDisconnected() is mostly useful when there is no event loop available.
See also disconnect(), close(), and disconnected().
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt qtextended4.4 | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com