Agora
1.2.0
Agora project
|
#include <gtest/gtest.h>
#include <atomic>
#include <string>
#include <thread>
#include "gettime.h"
#include "udp_client.h"
#include "udp_comm.h"
#include "udp_server.h"
#include "utils.h"
Functions | |
void | ClientSendTo (const std::string &src_address, uint16_t src_port, const std::string &dest_address, uint16_t dest_port) |
Test the non-connection use case (SendTo) More... | |
void | ClientConnect (const std::string &src_address, uint16_t src_port, const std::string &dest_address, uint16_t dest_port) |
Test the connection use case. More... | |
void | UDPSend (const std::string &local_address, uint16_t local_port, const std::string &remote_address, uint16_t remote_port) |
Test the connection use case. More... | |
void | ServerRecvFrom (const std::string &src_address, uint16_t src_port, const std::string &dest_address, uint16_t dest_port) |
void | ServerConnect (const std::string &src_address, const uint16_t src_port, const std::string &dest_address, const uint16_t dest_port) |
void | UDPRecv (const std::string &local_address, uint16_t local_port, const std::string &remote_address, uint16_t remote_port) |
Test the connection use case. More... | |
TEST (UDPClientServer, PerfIpv4) | |
TEST (UDPClientServer, PerfIpv6) | |
TEST (UDPClientServer, PerfIpv4RecvFrom) | |
TEST (UDPComm, PerfUDP) | |
TEST (UDPClientServer, ServerIsNonBlocking) | |
int | main (int argc, char **argv) |
Variables | |
static constexpr size_t | kSendPort = 3195 |
static constexpr size_t | kReceivePort = 3185 |
static constexpr size_t | kMessageSize = 9000 |
static constexpr size_t | kNumPackets = 10 |
static std::atomic< bool > | server_ready = false |
static const std::string | kIpv4Address = "127.0.0.1" |
static const std::string | kIpv6Address = "::1" |
void ClientConnect | ( | const std::string & | src_address, |
uint16_t | src_port, | ||
const std::string & | dest_address, | ||
uint16_t | dest_port | ||
) |
Test the connection use case.
Port will be selected by the system
void ClientSendTo | ( | const std::string & | src_address, |
uint16_t | src_port, | ||
const std::string & | dest_address, | ||
uint16_t | dest_port | ||
) |
Test the non-connection use case (SendTo)
int main | ( | int | argc, |
char ** | argv | ||
) |
void ServerConnect | ( | const std::string & | src_address, |
const uint16_t | src_port, | ||
const std::string & | dest_address, | ||
const uint16_t | dest_port | ||
) |
void ServerRecvFrom | ( | const std::string & | src_address, |
uint16_t | src_port, | ||
const std::string & | dest_address, | ||
uint16_t | dest_port | ||
) |
TEST | ( | UDPClientServer | , |
PerfIpv4 | |||
) |
TEST | ( | UDPClientServer | , |
PerfIpv4RecvFrom | |||
) |
TEST | ( | UDPClientServer | , |
PerfIpv6 | |||
) |
TEST | ( | UDPClientServer | , |
ServerIsNonBlocking | |||
) |
TEST | ( | UDPComm | , |
PerfUDP | |||
) |
void UDPRecv | ( | const std::string & | local_address, |
uint16_t | local_port, | ||
const std::string & | remote_address, | ||
uint16_t | remote_port | ||
) |
Test the connection use case.
void UDPSend | ( | const std::string & | local_address, |
uint16_t | local_port, | ||
const std::string & | remote_address, | ||
uint16_t | remote_port | ||
) |
Test the connection use case.
|
static |
|
static |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
static |