We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
----------------------------- Delete above -----------------------------
git rev-parse --short HEAD
代码来自example下面的udp_client.c的代码 while (1) {
int err = sendto(sock, payload, strlen(payload), 0, (struct sockaddr *)&destAddr, sizeof(destAddr)); if (err < 0) { ESP_LOGE(TAG, "Error occured during sending: errno %d", errno); break; } ESP_LOGI(TAG, "Message sent"); struct sockaddr_in sourceAddr; // Large enough for both IPv4 or IPv6 socklen_t socklen = sizeof(sourceAddr); sourceAddr.sin_addr.s_addr = inet_addr("255.255.255.255"); sourceAddr.sin_family = AF_INET; sourceAddr.sin_port = htonl(5560);//这边设置为本地端口,但是并没有用 // int32_t res = bind(sock,(struct sockaddr *)&sourceAddr,sizeof(sourceAddr)); // if(res != 0){ // printf("bind error\n"); // } int len = recvfrom(sock, rx_buffer, sizeof(rx_buffer) - 1, 0, (struct sockaddr *)&sourceAddr, &socklen); // Error occured during receiving if (len < 0) { ESP_LOGE(TAG, "recvfrom failed: errno %d", errno); break; } // Data received else { rx_buffer[len] = 0; // Null-terminate whatever we received and treat like a string ESP_LOGI(TAG, "Received %d bytes from %s:", len, addr_str); ESP_LOGI(TAG, "%s", rx_buffer); } vTaskDelay(50 / portTICK_PERIOD_MS); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
INSTRUCTIONS
----------------------------- Delete above -----------------------------
Environment
git rev-parse --short HEAD
to get the commit id.): 4c38ff3Problem Description
代码来自example下面的udp_client.c的代码
while (1) {
The text was updated successfully, but these errors were encountered: