(doc) Add more doc to SocketServer

This commit is contained in:
Benjamin Sergeant
2019-04-17 20:31:34 -07:00
parent d486c72e02
commit 52f460f66d
9 changed files with 34 additions and 20 deletions

View File

@ -258,7 +258,7 @@ namespace ix
return _webSocket->send(serializedJson).success;
}
//
//
// Extract the nonce from the handshake response
// use it to compute a hash during authentication
//
@ -357,7 +357,7 @@ namespace ix
if (!pdu.isMember("body")) return false;
Json::Value body = pdu["body"];
// Identify subscription_id, so that we can find
// Identify subscription_id, so that we can find
// which callback to execute
if (!body.isMember("subscription_id")) return false;
Json::Value subscriptionId = body["subscription_id"];
@ -531,5 +531,5 @@ namespace ix
{
connect();
}
} // namespace ix

View File

@ -90,7 +90,7 @@ namespace ix
/// Returns true only if we're connected
bool isConnected() const;
/// Flush the publish queue
bool flushQueue();
@ -128,7 +128,7 @@ namespace ix
///
/// Member variables
///
///
std::unique_ptr<WebSocket> _webSocket;
/// Configuration data
@ -158,10 +158,10 @@ namespace ix
std::unordered_map<std::string, SubscriptionCallback> _cbs;
mutable std::mutex _cbsMutex;
// Message Queue can be touched on control+background thread,
// Message Queue can be touched on control+background thread,
// protecting with a mutex.
//
// Message queue is used when there are problems sending messages so
// Message queue is used when there are problems sending messages so
// that sending can be retried later.
std::deque<std::string> _messageQueue;
mutable std::mutex _queueMutex;
@ -169,5 +169,5 @@ namespace ix
// Cap the queue size (100 elems so far -> ~100k)
static constexpr size_t kQueueMaxSize = 256;
};
} // namespace ix

View File

@ -110,10 +110,10 @@ namespace ix
Json::Value exception;
exception["value"] = msg["data"]["message"];
std::string stackTraceFieldName =
std::string stackTraceFieldName =
(msg["id"].asString() == "game_noisytypes_id") ? "traceback" : "stack";
exception["stacktrace"]["frames"] =
exception["stacktrace"]["frames"] =
parseLuaStackTrace(msg["data"][stackTraceFieldName].asString());
payload["exception"].append(exception);

View File

@ -43,5 +43,5 @@ namespace ix
HttpClient _httpClient;
};
} // namespace ix

View File

@ -70,7 +70,7 @@ namespace ix
const std::string& prefix,
const std::string& fields,
bool verbose);
int ws_cobra_to_sentry_main(const std::string& appkey,
const std::string& endpoint,
const std::string& rolename,

View File

@ -88,9 +88,9 @@ namespace ix
}
conn.setEventCallback(
[&conn, &channel, &jsonWriter,
[&conn, &channel, &jsonWriter,
verbose, &receivedCount, &sentCount,
&condition, &conditionVariableMutex,
&condition, &conditionVariableMutex,
&progressCondition, &queue]
(ix::CobraConnectionEventType eventType,
const std::string& errMsg,
@ -114,7 +114,7 @@ namespace ix
{
std::cerr << "Subscriber authenticated" << std::endl;
conn.subscribe(channel,
[&jsonWriter, verbose,
[&jsonWriter, verbose,
&sentCount, &receivedCount,
&condition, &conditionVariableMutex,
&progressCondition, &queue]
@ -132,7 +132,7 @@ namespace ix
receivedCount != 0 &&
(sentCount * scaleFactor < receivedCount))
{
std::cerr << "message dropped: sending is backlogged !"
std::cerr << "message dropped: sending is backlogged !"
<< std::endl;
condition.notify_one();