examples: Strip IPv6 function in example and use sockaddr_storage to replace sockaddr_in6

This commit is contained in:
yuanjm
2021-01-18 19:16:06 +08:00
parent da58235a0e
commit 821eea45b3
5 changed files with 13 additions and 9 deletions

View File

@@ -60,7 +60,7 @@ static void tcp_client_task(void *pvParameters)
addr_family = AF_INET6;
ip_protocol = IPPROTO_IPV6;
#elif defined(CONFIG_EXAMPLE_SOCKET_IP_INPUT_STDIN)
struct sockaddr_in6 dest_addr = { 0 };
struct sockaddr_storage dest_addr = { 0 };
ESP_ERROR_CHECK(get_addr_from_stdin(PORT, SOCK_STREAM, &ip_protocol, &addr_family, &dest_addr));
#endif
int sock = socket(addr_family, SOCK_STREAM, ip_protocol);