• Post Reply Bookmark Topic Watch Topic
  • New Topic

More than one client

 
francis varkey
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Respected Sirs,

I want to send a message from server to two or more clients.What is the steps for this. what is the role of Thread and HashTable in this case ?, If possible please give a simple sample code.

Thanks in advance.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, welcome to the ranch!

One way to look at this is that a server cannot send a message to a client at all. A good definition for a server is a process that waits for clients to connect and submit requests.

Your desktop PC can take on the server role and the giant blade stack on the raised floor can take on the client role. So I'm talking about the roles the two machines play at any instant, not what kind of machines they are or where they fit in your infrastructure.

So your PC can open a SocketServer port and the central big box can act as client, open a connection and send you a message. You probably need some kind of registration where your PC tells the server it is ready to accept messages. The server keeps a list of available clients so it can broadcast to all of them. Clients might de-register or the server could drop them from its list if it tries call them and fail.

Is that in line with your question?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!