954,157 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

connecting a client to multiple servers

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

Bhoot
Junior Poster in Training
53 posts since Oct 2008
Reputation Points: 10
Solved Threads: 1
 

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

Bhoot
Junior Poster in Training
53 posts since Oct 2008
Reputation Points: 10
Solved Threads: 1
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You