Add ping/pong to the protocol (#2)
This commit is contained in:
@@ -43,7 +43,7 @@ if (goog.DEBUG && !COMPILED) {
|
||||
* @private {!Array<!Array<number>>}
|
||||
* @const
|
||||
*/
|
||||
proto.ClientMessage.oneofGroups_ = [[11,12]];
|
||||
proto.ClientMessage.oneofGroups_ = [[11,12,13]];
|
||||
|
||||
/**
|
||||
* @enum {number}
|
||||
@@ -51,7 +51,8 @@ proto.ClientMessage.oneofGroups_ = [[11,12]];
|
||||
proto.ClientMessage.MsgCase = {
|
||||
MSG_NOT_SET: 0,
|
||||
NEW_EVAL: 11,
|
||||
EVAL_EVENT: 12
|
||||
EVAL_EVENT: 12,
|
||||
PING: 13
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -91,7 +92,8 @@ proto.ClientMessage.prototype.toObject = function(opt_includeInstance) {
|
||||
proto.ClientMessage.toObject = function(includeInstance, msg) {
|
||||
var f, obj = {
|
||||
newEval: (f = msg.getNewEval()) && node_pb.NewEvalMessage.toObject(includeInstance, f),
|
||||
evalEvent: (f = msg.getEvalEvent()) && node_pb.EvalEventMessage.toObject(includeInstance, f)
|
||||
evalEvent: (f = msg.getEvalEvent()) && node_pb.EvalEventMessage.toObject(includeInstance, f),
|
||||
ping: (f = msg.getPing()) && node_pb.Ping.toObject(includeInstance, f)
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
@@ -138,6 +140,11 @@ proto.ClientMessage.deserializeBinaryFromReader = function(msg, reader) {
|
||||
reader.readMessage(value,node_pb.EvalEventMessage.deserializeBinaryFromReader);
|
||||
msg.setEvalEvent(value);
|
||||
break;
|
||||
case 13:
|
||||
var value = new node_pb.Ping;
|
||||
reader.readMessage(value,node_pb.Ping.deserializeBinaryFromReader);
|
||||
msg.setPing(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
@@ -183,6 +190,14 @@ proto.ClientMessage.serializeBinaryToWriter = function(message, writer) {
|
||||
node_pb.EvalEventMessage.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
f = message.getPing();
|
||||
if (f != null) {
|
||||
writer.writeMessage(
|
||||
13,
|
||||
f,
|
||||
node_pb.Ping.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -246,6 +261,36 @@ proto.ClientMessage.prototype.hasEvalEvent = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional Ping ping = 13;
|
||||
* @return {?proto.Ping}
|
||||
*/
|
||||
proto.ClientMessage.prototype.getPing = function() {
|
||||
return /** @type{?proto.Ping} */ (
|
||||
jspb.Message.getWrapperField(this, node_pb.Ping, 13));
|
||||
};
|
||||
|
||||
|
||||
/** @param {?proto.Ping|undefined} value */
|
||||
proto.ClientMessage.prototype.setPing = function(value) {
|
||||
jspb.Message.setOneofWrapperField(this, 13, proto.ClientMessage.oneofGroups_[0], value);
|
||||
};
|
||||
|
||||
|
||||
proto.ClientMessage.prototype.clearPing = function() {
|
||||
this.setPing(undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return {!boolean}
|
||||
*/
|
||||
proto.ClientMessage.prototype.hasPing = function() {
|
||||
return jspb.Message.getField(this, 13) != null;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Generated by JsPbCodeGenerator.
|
||||
@@ -272,7 +317,7 @@ if (goog.DEBUG && !COMPILED) {
|
||||
* @private {!Array<!Array<number>>}
|
||||
* @const
|
||||
*/
|
||||
proto.ServerMessage.oneofGroups_ = [[13,14,15,16,17]];
|
||||
proto.ServerMessage.oneofGroups_ = [[13,14,15,16,17,18]];
|
||||
|
||||
/**
|
||||
* @enum {number}
|
||||
@@ -283,7 +328,8 @@ proto.ServerMessage.MsgCase = {
|
||||
EVAL_DONE: 14,
|
||||
EVAL_EVENT: 15,
|
||||
INIT: 16,
|
||||
SHARED_PROCESS_ACTIVE: 17
|
||||
SHARED_PROCESS_ACTIVE: 17,
|
||||
PONG: 18
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -326,7 +372,8 @@ proto.ServerMessage.toObject = function(includeInstance, msg) {
|
||||
evalDone: (f = msg.getEvalDone()) && node_pb.EvalDoneMessage.toObject(includeInstance, f),
|
||||
evalEvent: (f = msg.getEvalEvent()) && node_pb.EvalEventMessage.toObject(includeInstance, f),
|
||||
init: (f = msg.getInit()) && proto.WorkingInitMessage.toObject(includeInstance, f),
|
||||
sharedProcessActive: (f = msg.getSharedProcessActive()) && vscode_pb.SharedProcessActiveMessage.toObject(includeInstance, f)
|
||||
sharedProcessActive: (f = msg.getSharedProcessActive()) && vscode_pb.SharedProcessActiveMessage.toObject(includeInstance, f),
|
||||
pong: (f = msg.getPong()) && node_pb.Pong.toObject(includeInstance, f)
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
@@ -388,6 +435,11 @@ proto.ServerMessage.deserializeBinaryFromReader = function(msg, reader) {
|
||||
reader.readMessage(value,vscode_pb.SharedProcessActiveMessage.deserializeBinaryFromReader);
|
||||
msg.setSharedProcessActive(value);
|
||||
break;
|
||||
case 18:
|
||||
var value = new node_pb.Pong;
|
||||
reader.readMessage(value,node_pb.Pong.deserializeBinaryFromReader);
|
||||
msg.setPong(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
@@ -457,6 +509,14 @@ proto.ServerMessage.serializeBinaryToWriter = function(message, writer) {
|
||||
vscode_pb.SharedProcessActiveMessage.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
f = message.getPong();
|
||||
if (f != null) {
|
||||
writer.writeMessage(
|
||||
18,
|
||||
f,
|
||||
node_pb.Pong.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -610,6 +670,36 @@ proto.ServerMessage.prototype.hasSharedProcessActive = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional Pong pong = 18;
|
||||
* @return {?proto.Pong}
|
||||
*/
|
||||
proto.ServerMessage.prototype.getPong = function() {
|
||||
return /** @type{?proto.Pong} */ (
|
||||
jspb.Message.getWrapperField(this, node_pb.Pong, 18));
|
||||
};
|
||||
|
||||
|
||||
/** @param {?proto.Pong|undefined} value */
|
||||
proto.ServerMessage.prototype.setPong = function(value) {
|
||||
jspb.Message.setOneofWrapperField(this, 18, proto.ServerMessage.oneofGroups_[0], value);
|
||||
};
|
||||
|
||||
|
||||
proto.ServerMessage.prototype.clearPong = function() {
|
||||
this.setPong(undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return {!boolean}
|
||||
*/
|
||||
proto.ServerMessage.prototype.hasPong = function() {
|
||||
return jspb.Message.getField(this, 18) != null;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Generated by JsPbCodeGenerator.
|
||||
|
||||
Reference in New Issue
Block a user