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. :)

okay fine..it was a stupid question. After an hour or so, it clicked me to place the array in the class that i (infact, Visual Studio) would derive from Form class. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.