Debug: Testing pipeline from backend to client
This commit is contained in:
@@ -825,7 +825,7 @@ namespace Swarmops.Backend
|
||||
private static void BroadcastTimestamp()
|
||||
{
|
||||
JObject json = new JObject();
|
||||
json["messageType"] = "Timestamp";
|
||||
json["messageType"] = "Heartbeat";
|
||||
json["Timestamp"] = DateTime.UtcNow.ToUnix();
|
||||
|
||||
_socketServer.WebSocketServices.Broadcast(json.ToString());
|
||||
|
||||
@@ -252,6 +252,8 @@ namespace Swarmops.Frontend.Socket
|
||||
public static void OnBackendMessage(object sender, MessageEventArgs args)
|
||||
{
|
||||
Console.WriteLine(" - Backend message: " + args.Data);
|
||||
|
||||
_socketServer.WebSocketServices.Broadcast(args.Data); // send unfiltered to all sessions, for now
|
||||
}
|
||||
|
||||
public static void OnBackendOpen(object sender, EventArgs args)
|
||||
|
||||
@@ -34,10 +34,11 @@ namespace Swarmops.Frontend.Socket
|
||||
switch (serverRequest)
|
||||
{
|
||||
case "UpdateQueueCounts":
|
||||
Sessions.Broadcast (FrontendLoop.GetQueueInfoJson());
|
||||
// Sessions.Broadcast (FrontendLoop.GetQueueInfoJson());
|
||||
break;
|
||||
case "Ping":
|
||||
Sessions.Broadcast("{\"messageType\":\"Heartbeat\"}");
|
||||
// TODO: Request heartbeat from backend
|
||||
// Sessions.Broadcast("{\"messageType\":\"Heartbeat\"}");
|
||||
break;
|
||||
default:
|
||||
// do nothing;
|
||||
@@ -50,6 +51,9 @@ namespace Swarmops.Frontend.Socket
|
||||
Console.WriteLine(" * Attempted socket connection");
|
||||
|
||||
string authBase64 = Context.QueryString["Auth"];
|
||||
|
||||
// TODO: Check for valid system authority token
|
||||
|
||||
authBase64 = Uri.UnescapeDataString (authBase64); // Defensive programming - % sign does not exist in base64 so this won't ever collapse a working encoding
|
||||
|
||||
_authority = Authority.FromEncryptedXml (authBase64);
|
||||
@@ -57,13 +61,6 @@ namespace Swarmops.Frontend.Socket
|
||||
Console.WriteLine(" - - authenticated: " + _authority.Person.Canonical);
|
||||
|
||||
base.OnOpen();
|
||||
|
||||
if (Context.QueryString["Notify"] != "false")
|
||||
{
|
||||
Sessions.Broadcast ("{\"messageType\":\"EditorCount\"," +
|
||||
String.Format("\"editorCount\":\"{0}\"", Sessions.ActiveIDs.ToArray().Length) + '}');
|
||||
Send(FrontendLoop.GetQueueInfoJson());
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnClose (CloseEventArgs e)
|
||||
|
||||
@@ -32,7 +32,7 @@ function _masterInitializeSocket(authenticationTicket) {
|
||||
var message = $.parseJSON(data.data);
|
||||
|
||||
if (message.messageType == "Heartbeat") {
|
||||
//alertify.log("Master socket heartbeat");
|
||||
alertify.log("Master socket heartbeat: " + message.Timestamp);
|
||||
}
|
||||
else if (message.messageType == "SandboxUpdate") {
|
||||
if (odoLocalParticipation != undefined) { // Real ugly accessing specific page elements here, but it's temporary
|
||||
|
||||
Reference in New Issue
Block a user