private void sendSupportedFeatures() throws IOException {
        List<String> supportedFeatures = config.getSupportedFeatures();
        if (supportedFeatures!=null && !supportedFeatures.isEmpty()) {
            //building $Supports string
            String supportsString = "$Supports";
            for (String supportedFeature : supportedFeatures) {
                supportsString += " "+supportedFeature;
            }
            supportsString += "|";

            //sending hub $Supports string
            hubComm.sendDataToHub(supportsString);
            if (config.isDebugOn())
                System.err.println("Sent hub supports string. value is "+supportsString);
            String hubSupports = hubComm.getHubData();
            hub.addSupportedFeatures(hubSupports);
            if (config.isDebugOn())
                System.err.println("Hub responded with its supports string. value is "+hubSupports);
        } else if (config.isDebugOn()) {
            System.err.println("No supported features detected.");
        }
    }