#include <MessageProcessor.hpp>
Definition at line 145 of file MessageProcessor.hpp.
opentxs::MessageProcessor::MessageProcessor |
( |
ServerLoader & |
loader | ) |
|
|
explicit |
void opentxs::MessageProcessor::run |
( |
| ) |
|
Definition at line 214 of file MessageProcessor.cpp.
253 OTString messageString;
263 bool received = socket_.
Receive(messageString);
266 if (messageString.GetLength() <= 0) {
267 OTLog::Error(
"server main: Received a message, but of 0 "
268 "length or less. Weird. (Skipping it.)\n");
271 std::string strMsg(messageString.Get());
273 bool shouldDisconnect = processMessage(strMsg, reply);
275 if (reply.length() <= 0 || shouldDisconnect) {
277 0,
"server main: ERROR: Unfortunately, not every "
279 "legible or worthy of a server response. :-) "
286 bool successSending = socket_.
Send(reply.c_str());
288 if (!successSending) {
290 "while trying to send reply "
291 "back to client! \n\n "
292 "MESSAGE:\n%s\n\nREPLY:\n%s\n\n",
293 strMsg.c_str(), reply.c_str());
306 int64_t elapsed =
static_cast<int64_t
>(endTick - startTick);
314 OTLog::Output(0,
"opentxs server is shutting down gracefully.\n");
static EXPORT void vError(const char *szError,...)
static EXPORT void Output(int32_t nVerbosity, const char *szOutput)
EXPORT double getElapsedTimeInMilliSec()
bool IsFlaggedForShutdown() const
static int32_t GetHeartbeatNoRequests()
EXPORT bool Send(const OTASCIIArmor &ascEnvelope)
static EXPORT void Error(const char *szError)
static int32_t GetHeartbeatMsBetweenBeats()
static EXPORT bool SleepMilliseconds(int64_t lMilliseconds)
EXPORT bool Receive(OTString &strServerReply)
static EXPORT void vOutput(int32_t nVerbosity, const char *szOutput,...)
The documentation for this class was generated from the following files: