@@ -61,7 +61,7 @@ Client.prototype.setup = function(){
6161Client . prototype . connect = function ( name ) {
6262 debug ( 'connecting to namespace %s' , name ) ;
6363 if ( ! this . server . nsps [ name ] ) {
64- this . packet ( { type : parser . ERROR , nsp : name , data : 'Invalid namespace' } ) ;
64+ this . packet ( { type : parser . ERROR , nsp : name , data : 'Invalid namespace' } , false , false , true ) ;
6565 return ;
6666 }
6767 var nsp = this . server . of ( name ) ;
@@ -135,17 +135,18 @@ Client.prototype.close = function(){
135135 * @param {Object } packet object
136136 * @param {Boolean } whether packet is already encoded
137137 * @param {Boolean } whether packet is volatile
138+ * @param {Boolean } whether packet should be compressed
138139 * @api private
139140 */
140141
141- Client . prototype . packet = function ( packet , preEncoded , volatile ) {
142+ Client . prototype . packet = function ( packet , preEncoded , volatile , compress ) {
142143 var self = this ;
143144
144145 // this writes to the actual connection
145146 function writeToEngine ( encodedPackets ) {
146147 if ( volatile && ! self . conn . transport . writable ) return ;
147148 for ( var i = 0 ; i < encodedPackets . length ; i ++ ) {
148- self . conn . write ( encodedPackets [ i ] ) ;
149+ self . conn . write ( encodedPackets [ i ] , { compress : compress } ) ;
149150 }
150151 }
151152
0 commit comments