mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-04 05:39:53 +00:00
connect the UDP pcb to the DNS server (IPaddress and port) to receive faster (unconnected pcbs are very inefficient in udp_input)
This commit is contained in:
parent
b28cd02149
commit
92aa004b75
@ -464,6 +464,8 @@ dns_send(u8_t numdns, const char* name, u8_t id)
|
||||
/* resize pbuf to the exact dns query */
|
||||
pbuf_realloc(p, (query + sizeof(struct dns_query)) - ((char*)(p->payload)));
|
||||
|
||||
/* connect to the server for faster receiving */
|
||||
udp_connect(dns_pcb, &dns_servers[numdns], DNS_SERVER_PORT);
|
||||
/* send dns packet */
|
||||
err = udp_sendto(dns_pcb, p, &dns_servers[numdns], DNS_SERVER_PORT);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user