In the design I made one change:

just keep an array of the maximum size.
It works for multiple clients
   For this I am making connection with all the slaves for each connection
   request, and for closing the connection close connection with the slaves
   for that client, and remove the resource ids for that connection and to 
   do this I am keeping track of socket id for the master for this cpnnnection
   and then remove all the rid's for this connection.

It works for multiple servers
   To implement this I am keeping track of all the slaves for each connection,
   and to keep track I am using structure 'Slv' with the enteries
   struct Slv{
      int slave;
      int mark;
      };

   then we are keeping an array of this structure for each connection(client)
   . If it is able to make connection with the slave successfully then
   the repective 'mark' entry will be marked, otherwise 'mark' entry will
   be marked '0'. and when we are broadcasting it then if mark aentry for 
   a particular slave is '1' only then send the requests from the clients.
