Skip to content

Commit 6e7fdcc

Browse files
committed
Add wait for MDNS hostname to be set
1 parent e9dd254 commit 6e7fdcc

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ports/espressif/common-hal/mdns/Server.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ const char *common_hal_mdns_server_get_hostname(mdns_server_obj_t *self) {
9090

9191
void common_hal_mdns_server_set_hostname(mdns_server_obj_t *self, const char *hostname) {
9292
mdns_hostname_set(hostname);
93+
// Wait for the mdns task to set the new hostname.
94+
while (!mdns_hostname_exists(hostname)) {
95+
RUN_BACKGROUND_TASKS;
96+
}
9397
self->hostname = hostname;
9498
}
9599

ports/espressif/esp-idf

0 commit comments

Comments
 (0)