private MqttConnection CreateConnection() { var connection = new MqttConnection(); if (_config != null) { connection.Configure(_config); } if (_references != null) { connection.SetReferences(_references); } return(connection); }