public bool Start() { if (_shardPeersList == null || _shardPeersList.Count == 0) { return(false); } if (this._shardChannels == null) { this._shardChannels = new Dictionary <Server, IDualChannel>(); } try { //forming connections with all the nodes. if (_shardPeersList != null && _shardPeersList.Count != 0) { foreach (Server server in this._shardPeersList) { FormChannelConnection(server); if (LoggerManager.Instance.ShardLogger != null && LoggerManager.Instance.ShardLogger.IsInfoEnabled) { LoggerManager.Instance.ShardLogger.Info("LocalShard.Start()", "forming connections with the node:" + server.Address); } } } _membershipManager.BeginHeartbeatTasks(context, this, _connectionRestoration); if (LoggerManager.Instance.ShardLogger != null && LoggerManager.Instance.ShardLogger.IsInfoEnabled) { LoggerManager.Instance.ShardLogger.Info("LocalShard.Start()", "Local shard: " + Name + " started successfully on " + context.LocalAddress + "."); } } catch (Exception ex) { if (LoggerManager.Instance.ShardLogger != null && LoggerManager.Instance.ShardLogger.IsErrorEnabled) { LoggerManager.Instance.ShardLogger.Error("LocalShard.Start()", "Local shard: " + Name + " cannot started successfully : ", ex); } } return(true); }