1 var DRIVER_VERSION = require('../../constants/DriverVersion');
  2 
  3 module.exports = ClientInfoExchangePacket;
  4 
  5 /**
  6  * Constructor
  7  * @constructor
  8  */
  9 function ClientInfoExchangePacket() {
 10   this.newConnectionPort = 0;
 11 }
 12 
 13 /**
 14  * Write data
 15  * @param writer
 16  */
 17 ClientInfoExchangePacket.prototype.write = function (writer) {
 18   writer._writeFixedLengthString('CUBRK', 0, 5);
 19   writer._writeByte(3); // 3 = JDBC client type
 20   writer._writeByte(DRIVER_VERSION.CAS_VER);
 21   writer._writeByte(0);
 22   writer._writeByte(0);
 23   writer._writeByte(0);
 24 
 25   return writer;
 26 };
 27 
 28 /**
 29  * Read data
 30  * @param parser
 31  */
 32 ClientInfoExchangePacket.prototype.parse = function (parser) {
 33   this.newConnectionPort = parser._parseInt();
 34 
 35   return this;
 36 };
 37 
 38