Skip to main content
Visitor II
April 6, 2020
Question

How can I use LWIP to build again and again?

  • April 6, 2020
  • 0 replies
  • 519 views

I build the server to connected. but if i want change the port and built it again, it can't to use

have any advise?

void tcp_server_init(void)
{
 
 tpcb = tcp_new();
 
 if (tpcb != NULL)
 {
 err_t err;
 
 if((Server_port>=9999)||(Server_port<=2)){
 	err = tcp_bind(tpcb, IP_ADDR_ANY, TCP_LOCAL_PORT);
 }
 else{
 	err = tcp_bind(tpcb, IP_ADDR_ANY, Server_port);
 }
 
 if (err == ERR_OK)
 {
 tpcb = tcp_listen(tpcb);
 tcp_accept(tpcb, tcp_server_accept);
 }
 else
 {
 printf("can not bind pcb\r\n");
 }
 
 }
}

    This topic has been closed for replies.