943,772 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Marked Solved
  • Views: 862
  • C# RSS
May 7th, 2009
0

connecting a client to multiple servers

Expand Post »
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.
C# Syntax (Toggle Plain Text)
  1. class Clients
  2. {
  3. private TcpClient[] tcpClients = new TcpClients[5];
  4. }

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.
Similar Threads
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
Bhoot is offline Offline
53 posts
since Oct 2008
May 7th, 2009
0

Re: connecting a client to multiple servers

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.
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
Bhoot is offline Offline
53 posts
since Oct 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: why?!!!
Next Thread in C# Forum Timeline: crystal report problem





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC