I am developing a form application (UI) through which I need to connect a client to multiple servers.
For that, i would require an array of either Socket objects or TcpClient objects.
My dilemma is where i should put this array.
I cannot put the array in the static class containing the Main() method.
Also, i dont think it would be good to put it inside Main() (although, i may be wrong.)
I thought of placing it in an independent class so that i may add some functionality if required.
class Clients
{
private TcpClient[] tcpClients = new TcpClients[5];
}
But, i would face lots of problems here (like accessing the sockets).
Would anyone shed some light on this? I know this is a bit weird question. :)