Function handshake that test if the connection with the Warehouse micro-service is available
function handshake(param) {
    return new Promise((resolve, reject) => {
        if (types.isClientConfig(param)) {
            logger_1.logger.log('info', `Client config paramaters perfectly loaded`);
            logger_1.logger.log('debug', `Config file content: \n ${JSON.stringify(param)}`);
            let socket = io.connect(`http://${param.warehouseAddress}:${param.portSocket}`);
            socket.on('connect', function () {
                logger_1.logger.log('info', `Connection with Warehouse server succeed, starting communication...\n`);
                resolve();
            })
                .on('connect_error', function () {
                logger_1.logger.log('debug', `Connection with Warehouse server cannot be establish, disconnecting socket...\n`);
                reject();
                socket.disconnect();
            });
        }
        else {
            logger_1.logger.log('error', `Config file not in good format \n ${JSON.stringify(config)}`);
            reject();
        }
    });
}