This is the code I use:
I defined two tasks in the app_main.c
Code: Select all
xTaskCreate(&beat_task, "one_task", 2048, NULL, 4, NULL);
ESP_ERROR_CHECK( heap_trace_init_standalone(trace_record, NUM_RECORDS) );
xTaskCreate(&suitch_task, "two_task", 2048, NULL, 5, NULL);
s is a socket var, req is a pointer with dynamic value (this value is correctly filled)
Code: Select all
ESP_ERROR_CHECK( heap_trace_start(HEAP_TRACE_LEAKS) );
if (write(s, req, strlen(req)) < 0) {<<<<<problem here
ESP_LOGE(TAG, "... socket send failed");
close(s);
vTaskDelay(4000 / portTICK_PERIOD_MS);
continue;
}