Go to the documentation of this file.
22 TcpClient(
const string &ipAddress,
unsigned int port);
25 void * socket =
nullptr;
40 string getIpAddress()
const;
41 unsigned int getPort()
const;
45 optional<vector<unsigned char>*> send(
const vector<unsigned char> *bytes,
bool noResponse =
false,
bool close =
false);
46 optional<vector<unsigned char>*> receive();
49 bool isReleased()
const;
54 optional<unsigned int> getTimeout()
const;
60 void setTimeout(
unsigned timeoutSeconds);
65 void scheduleCloseAfterTimeout();
69 void cancelCloseAfterTimeout();
74 void *socket =
nullptr;
75 void *closeAfterTimeoutTimer =
nullptr;
76 void *strand =
nullptr;
78 bool releaseAsioContext =
true;
80 AsioState(
void *socket,
AsioContext *asioContext,
bool releaseAsioContext,
const string &loggerCategory);
84 inline static std::atomic<unsigned long long> counter = 0;
85 string loggerCategory =
"TcpClient_" +
to_string(++counter);
91 const string ipAddress =
"";
92 optional<unsigned> timeoutSeconds = {};
94 bool released =
false;
96 vector<unsigned char> bufferedBytes;
NLOHMANN_BASIC_JSON_TPL_DECLARATION std::string to_string(const NLOHMANN_BASIC_JSON_TPL &j)
user-defined to_string function for JSON values
Definition: json.hpp:26470
Definition: AsioContext.h:20
Definition: TcpClient.h:17
Definition: TcpClient.h:12
Definition: TcpClient.h:24
string loggerCategory
Definition: TcpClient.h:79
static std::unique_ptr< CscLogger > logger
Definition: gltfHelpers.cpp:6
Definition: conscience_log.cpp:20
static unique_ptr< CscLogger > getForCategory(string category)
Definition: conscience_log.cpp:119
Definition: TcpClient.h:71
Definition: CscEntityClient.h:6
TcpClientRuntimeError(const string &message)
Definition: TcpClient.h:14
std::shared_ptr< T > ptr
Definition: CscCommon.h:29