I want to loop through a collection of servers and ports (3 of each to be exact) and try to make a connection, once a connection is made I can move on with the rest of the code.. here is what i have.
IRC_SETTINGS IRC; //3 servers & 3 ports.
foreach (string SERVER in IRC.IRC_SERVERS)
{
try
{
ircSocket = new TcpClient(SERVER, PORT);
break; //;when we have a working connection.
}
catch(Exception){}
}
I guess that works fine for the servers part, but how do I go about looping through the ports at the same time? something like foreach (string server, int port in ....