Babel
Epitech's C++ VoIP project
|
Go to the documentation of this file.
24 void connect(
const std::string &hostname, uint16_t port)
override;
43 uint64_t
getId()
const override;
46 void setId(uint64_t
id)
override;
55 explicit QtTCPConnection(QWidget *parent =
nullptr, std::function<
void(
void)> onConnect = [](){});
uint16_t getPeerPort() const override
get the connected pair port
Definition: QtTCPConnection.cpp:122
std::function< void(Message< RFCCodes >)> _callbackMessageReceived
The function called when a message has been fully received.
Definition: QtTCPConnection.hpp:66
Definition: QtTCPConnection.hpp:17
uint64_t _bytesRead
used to track how much bytes of a message had been read
Definition: QtTCPConnection.hpp:72
Message< RFCCodes > _tmpMessage
Message used when reading a message.
Definition: QtTCPConnection.hpp:70
QtTCPConnection(QWidget *parent=nullptr, std::function< void(void)> onConnect=[](){})
ctor
Definition: QtTCPConnection.cpp:11
void send(Message< RFCCodes > message) override
Send the message.
Definition: QtTCPConnection.cpp:52
bool isConnected() const override
Tells if the connection is up.
Definition: QtTCPConnection.cpp:48
std::string getPeerIp() const override
Get the connected pair address.
Definition: QtTCPConnection.cpp:115
uint64_t getId() const override
Get the id of this connection.
Definition: QtTCPConnection.cpp:107
Definition: IAudioManager.hpp:13
Thread Safe queue.
Definition: TSQueue.hpp:17
Definition: ITCPConnection.hpp:16
TSQueue< Message< RFCCodes > > _messagesOut
All the messages that need to be sent.
Definition: QtTCPConnection.hpp:68
void connect(const std::string &hostname, uint16_t port) override
connect to a hostname and a port
Definition: QtTCPConnection.cpp:39
void setId(uint64_t id) override
set the id of the connection
Definition: QtTCPConnection.cpp:111
void readMessage()
Read a Message<T> from the socket when a message is read _callbackMessageReceived is called.
Definition: QtTCPConnection.cpp:66
QTcpSocket * _socket
The socket internally used.
Definition: QtTCPConnection.hpp:63
uint64_t _connectionId
id used to identify the connection
Definition: QtTCPConnection.hpp:74
void disconnect() override
disconnect the connection
Definition: QtTCPConnection.cpp:44
void readForMessages() override
listen for new messages
Definition: QtTCPConnection.cpp:63
void setCallbackOnMessage(std::function< void(Message< RFCCodes >)> callMessageReceived) override
Called when we received a message.
Definition: QtTCPConnection.cpp:103