lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] Netconn API for UDP and Raw API for TCP


From: Pablo Ledergerber
Subject: [lwip-users] Netconn API for UDP and Raw API for TCP
Date: Wed, 6 Feb 2019 13:38:57 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0

Hi,

I have running a multithreaded system. In one thread I have a such of discovery function over UDP and programmed with the netconn API. The other thread sent and receive data over tcp. This one is programmed with the raw API. With the discovery thread I'm able to change the IP Address on the fly. When I do that, the following code is running to set the new data and restart the interface:

                        netconn_close(conn);
                        netif_set_addr(udp_netif, &newip, &netmask, &gateway);
                        netif_set_up(udp_netif);
                        netif_set_default(udp_netif);
                        err = netconn_bind(conn, IP_ADDR_ANY, 5556);

If I do that twice, my tcp connection over the raw tcp is broken. All functions of the raw tcp api are called from the tcp thread. My question:
- If I close the netconn connection, what does it happen with the tcp connection? is going to close as well?
- how is the rigth order to shutdown both interfaces and restart it again?

Thank you in advance

Pablo

reply via email to

[Prev in Thread] Current Thread [Next in Thread]