本文整理汇总了C#中StackExchange.Redis.ConnectionMultiplexer.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# ConnectionMultiplexer.Dispose方法的具体用法?C# ConnectionMultiplexer.Dispose怎么用?C# ConnectionMultiplexer.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StackExchange.Redis.ConnectionMultiplexer
的用法示例。
在下文中一共展示了ConnectionMultiplexer.Dispose方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MainForm
public MainForm()
{
InitializeComponent();
var options = new ConfigurationOptions
{
ConnectTimeout = 5000,
SyncTimeout = 2000,
KeepAlive = 60,
EndPoints =
{
{Settings.Default.RedisHost, Settings.Default.RedisPort}
}
};
_redis = ConnectionMultiplexer.Connect(options);
var retries = 0;
while (!_redis.IsConnected)
{
var config = _redis.Configuration;
_redis.Dispose();
if (retries > 10)
{
MessageBox.Show(string.Format("Could not connect to the Redis server with configuration: {0}",
config));
Application.Exit();
}
_redis = ConnectionMultiplexer.Connect(options, Console.Out);
retries++;
}
_red = new LightControlSet(button_RedOn, button_RedOff, button_RedFlash, textBox_RedOnDuty, textBox_RedOffDuty, textBox_RedOffset, textBox_RedPower, button_RedApply);
_green = new LightControlSet(button_GreenOn, button_GreenOff, button_GreenFlash, textBox_GreenOnDuty, textBox_GreenOffDuty, textBox_GreenOffset, textBox_GreenPower, button_GreenApply);
_blueYellow = new LightControlSet(button_BlueOn, button_BlueOff, button_BlueFlash, textBox_BlueOnDuty, textBox_BlueOffDuty, textBox_BlueOffset, textBox_BluePower, button_BlueApply);
}