src/com/company/Server/CentralNode.java
public SynchronizedArrayList<MulticastSocket> updateMulticastGroups(SynchronizedArrayList<WorkerThread> clientsConnected,
                                                                        SynchronizedArrayList<MulticastSocket> multicastGroups) {

        for (int i = 0; i < clientsConnected.get().size(); i++) {
            if (!isMulticastGroupPortExists(clientsConnected.get().get(i).client, multicastGroups)) {
                try {
                    int port = this.readWriteFiles.getClientCountyPort(clientsConnected.get().get(i).client);
                    multicastGroups.add(new MulticastSocket(port));
                } catch (UnknownHostException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

        return multicastGroups;
    }
/**
     * Method responsible for updating the port list of client multicast groups
     * @param clientsConnected array of clients currently connected to the application
     * @param multicastGroups  client multicastsocket array
     * @return updated array of multicastsockets clients
     */
Method responsible for updating the port list of client multicast groups
@param clientsConnected array of clients currently connected to the application
@param multicastGroups  client multicastsocket array
@return updated array of multicastsockets clients
Method responsible for updating the port list of client multicast groups @param clientsConnected array of clients currently connected to the application @param multicastGroups client multicastsocket array @return updated array of multicastsockets clients
public SynchronizedArrayList<MulticastSocket> updateMulticastGroups(SynchronizedArrayList<WorkerThread> clientsConnected,
                                                                        SynchronizedArrayList<MulticastSocket> multicastGroups) {
        for (int i = 0; i < clientsConnected.get().size(); i++) {
            if (!isMulticastGroupPortExists(clientsConnected.get().get(i).client, multicastGroups)) {
                try {
                    int port = this.readWriteFiles.getClientCountyPort(clientsConnected.get().get(i).client);
                    multicastGroups.add(new MulticastSocket(port));
                } catch (UnknownHostException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
        return multicastGroups;
    }
public SynchronizedArrayList < MulticastSocket > updateMulticastGroups ( SynchronizedArrayList < WorkerThread > clientsConnected , SynchronizedArrayList < MulticastSocket > multicastGroups ) { for ( int i = 0 ; i < clientsConnected . get ( ) . size ( ) ; i ++ ) { if ( ! isMulticastGroupPortExists ( clientsConnected . get ( ) . get ( i ) . client , multicastGroups ) ) { try { int port = this . readWriteFiles . getClientCountyPort ( clientsConnected . get ( ) . get ( i ) . client ) ; multicastGroups . add ( new MulticastSocket ( port ) ) ; } catch ( UnknownHostException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } } return multicastGroups ; }
Method responsible for updating the port list of client multicast groups
 @param clientsConnected array of clients currently connected to the application
 @param multicastGroups  client multicastsocket array
 @return updated array of multicastsockets clients
Method responsible for updating the port list of client multicast groups @param clientsConnected array of clients currently connected to the application @param multicastGroups client multicastsocket array @return updated array of multicastsockets clients