_handleSocketData(socket) {
        debug('socket connected');
        this.sockets.push(socket);
        socket.on('data', data => {
            const dataStr = data.toString('hex');
            debug(`got data: ${dataStr}`);
            if (data[7] === 0x15) {
                this.lastPingTime = Date.now();
            } else {
                this.lastDataPackets.push(dataStr);
            }
            if (requestResponse[dataStr]) {
                debug(`response data: ${requestResponse[dataStr].toString('hex')}`);
                socket.write(requestResponse[dataStr]);

                if (dataStr === '000000030400009002' && !this.dataSendTimeout) {
                    this._sendDataPerInterval(socket);
                }
            }
        });

        socket.on('close', () => debug('socket closed'));

        socket.on('error', err => debug(`socket errored: ${err}`));
    }
/**
     * Handle connected Sockets and handle prepared responses
     *
     * @param {Socket} socket connected Socket
     * @private
     */
Handle connected Sockets and handle prepared responses
@param {Socket} socket connected Socket
@private
Handle connected Sockets and handle prepared responses @param { Socket } socket connected Socket @private
_handleSocketData(socket) {
        debug('socket connected');
        this.sockets.push(socket);
        socket.on('data', data => {
            const dataStr = data.toString('hex');
            debug(`got data: ${dataStr}`);
            if (data[7] === 0x15) {
                this.lastPingTime = Date.now();
            } else {
                this.lastDataPackets.push(dataStr);
            }
            if (requestResponse[dataStr]) {
                debug(`response data: ${requestResponse[dataStr].toString('hex')}`);
                socket.write(requestResponse[dataStr]);
                if (dataStr === '000000030400009002' && !this.dataSendTimeout) {
                    this._sendDataPerInterval(socket);
                }
            }
        });
        socket.on('close', () => debug('socket closed'));
        socket.on('error', err => debug(`socket errored: ${err}`));
    }
_handleSocketData ( socket ) { debug ( 'socket connected' ) ; this . sockets . push ( socket ) ; socket . on ( 'data' , data => { const dataStr = data . toString ( 'hex' ) ; debug ( ` ${ dataStr } ` ) ; if ( data [ 7 ] === 0x15 ) { this . lastPingTime = Date . now ( ) ; } else { this . lastDataPackets . push ( dataStr ) ; } if ( requestResponse [ dataStr ] ) { debug ( ` ${ requestResponse [ dataStr ] . toString ( 'hex' ) } ` ) ; socket . write ( requestResponse [ dataStr ] ) ; if ( dataStr === '000000030400009002' && ! this . dataSendTimeout ) { this . _sendDataPerInterval ( socket ) ; } } } ) ; socket . on ( 'close' , ( ) => debug ( 'socket closed' ) ) ; socket . on ( 'error' , err => debug ( ` ${ err } ` ) ) ; }
Handle connected Sockets and handle prepared responses
 @param {Socket} socket connected Socket
 @private
Handle connected Sockets and handle prepared responses @param { Socket } socket connected Socket @private