1#ifndef NET_TCP_CLIENT_H
2#define NET_TCP_CLIENT_H
15 TcpClient(std::unique_ptr<Xale::Net::ISocketFactory> socketFactory);
24 bool connect(
const std::string& ip,
int port);
33 int send(
const std::string* data,
size_t size);
42 int receive(std::string* buffer,
size_t size);
65 std::unique_ptr<Xale::Net::ISocket> _socket;
66 std::unique_ptr<Xale::Net::ISocketFactory> _socketFactory;
Represents a network packet for communication in Xale DB.
Definition Packet.h:15
~TcpClient()
Definition TcpClient.cpp:10
int receive(std::string *buffer, size_t size)
Receives data from the connected TCP server.
Definition TcpClient.cpp:34
TcpClient(std::unique_ptr< Xale::Net::ISocketFactory > socketFactory)
Definition TcpClient.cpp:5
bool connect(const std::string &ip, int port)
Connects to a TCP server at the specified IP address and port.
Definition TcpClient.cpp:15
void close()
Closes the connection to the TCP server.
Definition TcpClient.cpp:64
int send(const std::string *data, size_t size)
Sends data to the connected TCP server.
Definition TcpClient.cpp:26