diff --git a/nodejs-client/src/dsn/dsn_types.js b/nodejs-client/src/dsn/dsn_types.js index ab3570589e..d7e1a32501 100644 --- a/nodejs-client/src/dsn/dsn_types.js +++ b/nodejs-client/src/dsn/dsn_types.js @@ -257,26 +257,38 @@ rpc_address.prototype.equals = function(other){ }; // TODO(yingchun): host_port is now just a place holder and not well implemented, need improve it +// Error code enum +var host_port_type = { + HOST_TYPE_INVALID : 0, + HOST_TYPE_IPV4 : 1, + HOST_TYPE_GROUP : 2 +}; var host_port = function(args) { this.host = null; this.port = 0; + this.type = host_port_type.HOST_TYPE_INVALID; if(args && args.host){ this.host = args.host; } if(args && args.port){ this.port = args.port; } + if(args && args.type){ + this.type = args.type; + } }; host_port.prototype = {}; host_port.prototype.read = function(input){ this.host = input.readBinary(); this.port = input.readI16(); + this.type = input.readByte(); }; host_port.prototype.write = function(output){ output.writeBinary(this.host); output.writeI16(this.port); + output.writeByte(this.type); }; //value, calculate by app_id and partition index