This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

how to reinitialise tcp connection to new ip in running state.

Hi all,

      i am using tm4c129 controller. I have written code of tcp master as bellow.

A)

/* initiasliastion */

then

 pcb= tcp_new();

tcp_bind(pcb,IO_ADDR)ANY,PORT);

pcb= tcp_listen(pcb);

tcp_accept(pcb, accept);

   now i want to change my ip (master ip)

so i call function as:

B)

tcp_arg(pcb,NULL);

tcp_sent(pcb,NULL);

tcp_receive(pcb,NULL);

tcp_close(pcb);

C)

 after this i called :

lwIPNetworkConfigChange(new_ip, new_subnetmask,0,IPADDR_USE_STATIC);

then again:

 pcb= tcp_new();

tcp_bind(pcb,IO_ADDR)ANY,PORT);

pcb= tcp_listen(pcb);

tcp_accept(pcb, accept);

But i found that after some time 10 sec my entire application get hanged. what is problem in new ip config or in freeing old pcb struct?

Regards,

Sagar