8#include "./network_socket.h"
10namespace AsyncBsdSocketLib
17 struct sockaddr_in mAddress;
44 template <std::
size_t N>
45 ssize_t
Send(const std::array<uint8_t, N> &buffer) const noexcept
62 template <std::
size_t N>
63 ssize_t
Receive(std::array<uint8_t, N> &buffer)
const noexcept
int FileDescriptor
File descriptor.
Definition: communicator.h:13
TCP/IP network socket.
Definition: network_socket.h:13
TCP client to connect to a TcpListener.
Definition: tcp_client.h:15
TcpClient(std::string ipAddress, uint16_t port)
Constructor.
bool TrySetup() noexcept override
Try to setup the communicator.
bool IsConnected() const noexcept
Inidicates whether the client is connected or not.
int Connection() const noexcept override
Connection descriptor for sending and receiving.
ssize_t Send(const std::array< uint8_t, N > &buffer) const noexcept
Send a byte array to the connected client.
Definition: tcp_client.h:45
ssize_t Receive(std::array< uint8_t, N > &buffer) const noexcept
Receive a byte array from the connected client.
Definition: tcp_client.h:63
bool TryConnect() noexcept
Try to connect to the server.