Community
Participate
Working Groups
After looking in https://github.com/eclipse/paho.mqtt.embedded-c , specifically https://github.com/eclipse/paho.mqtt.embedded-c/blob/master/MQTTClient-C/src/FreeRTOS/MQTTFreeRTOS.c I think "if ((ipAddress = FreeRTOS_gethostbyname(addr)) == 0)" and relevant parts in NetworkConnect should be replaced by getaddrinfo, that request and returns ipv6 properly. For example, in my platform dependent code, freertos as well (it is a bit different from original paho code and important, this particular code is ipv6 only) it is like this static int NetworkConnect6(Network* n, char *addr, char *service) { const struct addrinfo hints = { .ai_family = AF_INET6, .ai_socktype = SOCK_STREAM, }; struct addrinfo *res; int err = getaddrinfo(addr, service, &hints, &res); if (err != 0 || res == NULL) { return(-1); } n->my_socket = socket(res->ai_family, res->ai_socktype, 0); if (n->my_socket < 0) { freeaddrinfo(res); return(-2); } if (connect(n->my_socket, res->ai_addr, res->ai_addrlen) != 0) { close(n->my_socket); freeaddrinfo(res); return(-3); } freeaddrinfo(res); return(0); }