code: function() {
      
          that.connected = true;
          that.tcp_connection.setKeepAlive( true );	
          
          if ( that.message_buffer.length ) {
              while( that.message_buffer.length ) {
                  that.tcp_connection.write( that.message_buffer.shift() );
              }
          }
      }
docs: on connect we need to check if we have any messages in the the message buffer, send them if so but first send a new connect message