socket positive
More...
#include <PeerConnection.h>
|
void | stateChanged (PeerConnection::ConnectionState state) |
| Emitted when the connection state changes.
|
|
void | connected () |
| Emitted when a connection is successfully established.
|
|
void | disconnected () |
| Emitted when the connection is terminated.
|
|
void | dataReceived (const QByteArray &data) |
| Emitted when data is received from the peer.
|
|
void | bytesWritten (qint64 bytesWritten) |
| Emitted to report the result of a send operation.
|
|
void | errorOccurred (QAbstractSocket::SocketError socketError) |
| Emitted when a network error occurs.
|
|
|
| Q_ENUM (ConnectionState) |
|
| PeerConnection (QObject *parent) |
|
| Q_DISABLE_COPY_MOVE (PeerConnection) |
|
bool | availableSelfListen (const SelfInfo &info) |
| listen for the P2P available
|
|
bool | connectToPeer (const PeerInfo &peerInfo) |
|
SelfInfo | selfInfo () const |
|
PeerInfo | peerInfo () const |
| Gets the information of the connected remote peer.
|
|
ConnectionState | state () const |
| Returns the current state of the connection.
|
|
bool | send_data (const QByteArray &raw_data) |
| Asynchronously sends data to the connected peer.
|
|
void | disconnectFromPeer () |
| Closes the current connection and stops listening. Resets the object to its initial state.
|
|
const QString | uuid () const |
| get the only one uuid
|
|
◆ ConnectionState
Defines the current state of the peer connection.
Enumerator |
---|
Disconnected | No active connection.
|
Listening | Listening for an incoming connection.
|
Connecting | Attempting to connect to a peer.
|
Connected | An active connection is established.
|
◆ bytesWritten
void PeerConnection::bytesWritten |
( |
qint64 |
bytesWritten | ) |
|
|
signal |
Emitted to report the result of a send operation.
- Parameters
-
bytesWritten | The number of bytes successfully written to the socket. |
◆ dataReceived
void PeerConnection::dataReceived |
( |
const QByteArray & |
data | ) |
|
|
signal |
Emitted when data is received from the peer.
- Parameters
-
◆ errorOccurred
void PeerConnection::errorOccurred |
( |
QAbstractSocket::SocketError |
socketError | ) |
|
|
signal |
Emitted when a network error occurs.
- Parameters
-
socketError | The specific error code. |
◆ peerInfo()
PeerInfo PeerConnection::peerInfo |
( |
| ) |
const |
Gets the information of the connected remote peer.
- Returns
- A PeerInfo object for the connected peer. Returns an invalid object if not connected.
◆ send_data()
bool PeerConnection::send_data |
( |
const QByteArray & |
raw_data | ) |
|
Asynchronously sends data to the connected peer.
- Parameters
-
data | The QByteArray data to send. |
- Returns
- True if the data was queued for sending, false if there is no active connection.
◆ stateChanged
Emitted when the connection state changes.
- Parameters
-
state | The new state of the connection. |
◆ uuid()
const QString PeerConnection::uuid |
( |
| ) |
const |
|
inline |
get the only one uuid
- Returns
The documentation for this class was generated from the following files:
- extern_app/CCommunicator/library/networking/PeerConnection.h
- extern_app/CCommunicator/library/networking/PeerConnection.cpp