私は接続状態を再確認するために、同時に接続を確立し、数分ごとに接続する必要がある14種類のデバイスがあります。複数のデバイスに接続する
私はそれぞれのスレッドを作成する必要があるのか、それとももっと良い方法があるのだろうかと思います。
public partial class Automation : Form
{
public Automation()
{
InitializeComponent();
}
//======================================================================
TelnetConnection Telnet1 = new TelnetConnection("10.10.100.21", 9090);
TelnetConnection Telnet2 = new TelnetConnection("10.10.100.22", 9090);
TelnetConnection Telnet3 = new TelnetConnection("10.10.100.23", 9090);
TelnetConnection Telnet4 = new TelnetConnection("10.10.100.24", 9090);
TelnetConnection Telnet5 = new TelnetConnection("10.10.100.25", 9090);
TelnetConnection Telnet6 = new TelnetConnection("10.10.100.26", 9090);
TelnetConnection Telnet7 = new TelnetConnection("10.10.100.27", 9090);
//======================================================================
TelnetConnection ADV1 = new TelnetConnection("10.10.100.1", 9090);
TelnetConnection ADV2 = new TelnetConnection("10.10.100.2", 9090);
TelnetConnection ADV3 = new TelnetConnection("10.10.100.3", 9090);
TelnetConnection ADV4 = new TelnetConnection("10.10.100.4", 9090);
TelnetConnection ADV5 = new TelnetConnection("10.10.100.5", 9090);
TelnetConnection ADV6 = new TelnetConnection("10.10.100.6", 9090);
TelnetConnection ADV7 = new TelnetConnection("10.10.100.7", 9090);
//======================================================================
private void Automation_Load(object sender, EventArgs e)
{
//===========Check Online State===========//
Check_Online_Offline_State();
//===========Check Online State===========//
}
}
また を必要な時はいつでも私は、デバイスの各コマンド1を送信することがありますが、それらは3接続した後、例外に遭遇するが、私は唯一のADVSを実行する場合、接続の罰金を確立しているため、問題は、telnet接続です。
提案?
_ - WHAT EXCEPTION? –
IPのうちの1つがオンラインでないか、またはプログラムに達することができない場合、すべて – Extzy