aws-iot-greengrass-for-beginners/alert/main.py [108:132]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    tls_context = io.ClientTlsContext(tls_options)

    socket_options = io.SocketOptions()
    socket_options.connect_timeout_ms = 3000

    logger.info('Performing greengrass discovery...')
    discovery_client = DiscoveryClient(
        client_bootstrap, socket_options, tls_context, region)
    resp_future = discovery_client.discover(device_name)
    discover_response = resp_future.result()

    logger.debug(discover_response)

    for gg_group in discover_response.gg_groups:
        for gg_core in gg_group.cores:
            for connectivity_info in gg_core.connectivity:
                try:
                    print(
                        'Trying core {} at host {} port {}'.format(
                            gg_core.thing_arn,
                            connectivity_info.host_address,
                            connectivity_info.port))
                    connection = mqtt_connection_builder.mtls_from_path(
                        endpoint=connectivity_info.host_address,
                        port=connectivity_info.port,
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



aws-iot-greengrass-for-beginners/sensor/main.py [109:133]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    tls_context = io.ClientTlsContext(tls_options)

    socket_options = io.SocketOptions()
    socket_options.connect_timeout_ms = 3000

    logger.info('Performing greengrass discovery...')
    discovery_client = DiscoveryClient(
        client_bootstrap, socket_options, tls_context, region)
    resp_future = discovery_client.discover(device_name)
    discover_response = resp_future.result()

    logger.debug(discover_response)

    for gg_group in discover_response.gg_groups:
        for gg_core in gg_group.cores:
            for connectivity_info in gg_core.connectivity:
                try:
                    print(
                        'Trying core {} at host {} port {}'.format(
                            gg_core.thing_arn,
                            connectivity_info.host_address,
                            connectivity_info.port))
                    connection = mqtt_connection_builder.mtls_from_path(
                        endpoint=connectivity_info.host_address,
                        port=connectivity_info.port,
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



