Interface representing UdpCommunication.
More...
#include <IUdpCommunication.hpp>
|
virtual | ~IUdpCommunication ()=default |
| Destroy the IUdpCommunication object.
|
|
virtual void | send (std::vector< byte > const &data)=0 |
| A method to send a message to the already known ip adress and port adress. More...
|
|
virtual void | send (std::vector< byte > const &data, asio::ip::address const &address, unsigned short const &port)=0 |
| A method to send a message to an ip adress and port adress. More...
|
|
virtual void | async_send (std::vector< byte > const &data, std::function< void(std::error_code const &, std::size_t)> callBack)=0 |
| A method to send a message to an already known ip adress and port adress in an async way. More...
|
|
virtual void | async_send (std::vector< byte > const &data, std::function< void(std::error_code const &, std::size_t)> callBack, asio::ip::address const &address, unsigned short const &port)=0 |
| A method to send a message to a ip adress and port adress in an async way. More...
|
|
virtual std::pair< asio::ip::address, unsigned short > | receive (std::vector< byte > &data)=0 |
| A method to receive a message. More...
|
|
virtual void | async_receive (std::vector< byte > &data, std::function< void(std::error_code const &, std::size_t)> callBack)=0 |
| A method to receive a message in an async way. More...
|
|
virtual std::pair< asio::ip::address, unsigned short > | getEnpointInfo () const =0 |
| Get the Enpoint Info object. More...
|
|
virtual void | setEnpointInfo (std::pair< asio::ip::address, unsigned short > const &endpointInfo)=0 |
| Set the Enpoint Info object. More...
|
|
virtual void | setEnpointInfo (asio::ip::address const &address, unsigned short const &port)=0 |
| Set the Enpoint Info object. More...
|
|
Interface representing UdpCommunication.
◆ async_receive()
virtual void IUdpCommunication::async_receive |
( |
std::vector< byte > & |
data, |
|
|
std::function< void(std::error_code const &, std::size_t)> |
callBack |
|
) |
| |
|
pure virtual |
A method to receive a message in an async way.
- Parameters
-
data | The buffer to fill when the message is received |
callBack | The function called once the message is received |
Implemented in UdpCommunication.
◆ async_send() [1/2]
virtual void IUdpCommunication::async_send |
( |
std::vector< byte > const & |
data, |
|
|
std::function< void(std::error_code const &, std::size_t)> |
callBack |
|
) |
| |
|
pure virtual |
A method to send a message to an already known ip adress and port adress in an async way.
- Parameters
-
data | The serilized |
callBack | The function to call once the message is sent |
Implemented in UdpCommunication.
◆ async_send() [2/2]
virtual void IUdpCommunication::async_send |
( |
std::vector< byte > const & |
data, |
|
|
std::function< void(std::error_code const &, std::size_t)> |
callBack, |
|
|
asio::ip::address const & |
address, |
|
|
unsigned short const & |
port |
|
) |
| |
|
pure virtual |
A method to send a message to a ip adress and port adress in an async way.
- Parameters
-
data | The serialized message |
callBack | The function called once the message is sent |
address | The ip adress to send the message |
port | The port adress to send the message |
Implemented in UdpCommunication.
◆ getEnpointInfo()
virtual std::pair<asio::ip::address, unsigned short> IUdpCommunication::getEnpointInfo |
( |
| ) |
const |
|
pure virtual |
Get the Enpoint Info object.
- Returns
- std::pair<asio::ip::address, unsigned short> Pair with the ip address and the port of the endpoint
Implemented in UdpCommunication.
◆ receive()
virtual std::pair<asio::ip::address, unsigned short> IUdpCommunication::receive |
( |
std::vector< byte > & |
data | ) |
|
|
pure virtual |
A method to receive a message.
- Parameters
-
data | The buffer to fill when the message is received |
- Returns
- std::pair<asio::ip::address, unsigned short> The ip adress and the port adress where the message came from
Implemented in UdpCommunication.
◆ send() [1/2]
virtual void IUdpCommunication::send |
( |
std::vector< byte > const & |
data | ) |
|
|
pure virtual |
A method to send a message to the already known ip adress and port adress.
- Parameters
-
data | The serialized message |
Implemented in UdpCommunication.
◆ send() [2/2]
virtual void IUdpCommunication::send |
( |
std::vector< byte > const & |
data, |
|
|
asio::ip::address const & |
address, |
|
|
unsigned short const & |
port |
|
) |
| |
|
pure virtual |
A method to send a message to an ip adress and port adress.
- Parameters
-
data | The serialized message |
address | The ip adress to send the message |
port | The port adress to send the message |
Implemented in UdpCommunication.
◆ setEnpointInfo() [1/2]
virtual void IUdpCommunication::setEnpointInfo |
( |
asio::ip::address const & |
address, |
|
|
unsigned short const & |
port |
|
) |
| |
|
pure virtual |
Set the Enpoint Info object.
- Parameters
-
address | Ip address of the endpoint |
port | Port of the endpoint |
Implemented in UdpCommunication.
◆ setEnpointInfo() [2/2]
virtual void IUdpCommunication::setEnpointInfo |
( |
std::pair< asio::ip::address, unsigned short > const & |
endpointInfo | ) |
|
|
pure virtual |
Set the Enpoint Info object.
- Parameters
-
endpointInfo | Pair with the ip address and the port of the endpoint |
Implemented in UdpCommunication.
The documentation for this class was generated from the following file:
- /home/gurvan-le-letty/delivery/epitech_delivery/semester_5/B-CPP-500/B-CPP-500-PAR-5-1-rtype-martin.vanaud/Libraries/Network/UdpCommunication/IUdpCommunication.hpp