I am trying to do TCP connection between two stm32 device. Firstly everything is perfect between the line we see on the wireshark.When the TCP client reset and try to send new data, wireshark shows me Retransmittion TCP message but when I debug the server side, server side get the message and send echo message after client receive this echo message.
Why the retransmition message shows, althoug I get and send message to other side ?
FULL client code: https://paste.ubuntu.com/p/VJHzgv29FM/
FULL server code : https://paste.ubuntu.com/p/Wm9gvkSfF7/
/**
* @brief Initializes the tcp echo server
* @param None
* @retval None
*/
void tcp_echoserver_init(void)
{
/* create new tcp pcb */
tcp_echoserver_pcb = tcp_new();
if (tcp_echoserver_pcb != NULL)
{
err_t err;
/* bind echo_pcb to port 7 (ECHO protocol) */
err = tcp_bind(tcp_echoserver_pcb, IP_ADDR_ANY, 7);
if (err == ERR_OK)
{
/* start tcp listening for echo_pcb */
tcp_echoserver_pcb = tcp_listen(tcp_echoserver_pcb);
/* initialize LwIP tcp_accept callback function */
tcp_accept(tcp_echoserver_pcb, tcp_echoserver_accept);
}
else
{
/* deallocate the pcb */
memp_free(MEMP_TCP_PCB, tcp_echoserver_pcb);
}
}
}
Client:
/**
* @brief Connects to the TCP echo server
* @param None
* @retval None
*/
void tcp_echoclient_connect(void)
{
ip_addr_t DestIPaddr;
/* create new tcp pcb */
echoclient_pcb = tcp_new();
if (echoclient_pcb != NULL)
{
IP4_ADDR(&DestIPaddr, (uint8_t)192, (uint8_t)168, (uint8_t)1, (uint8_t)40);
/* connect to destination address/port */
tcp_connect(echoclient_pcb,&DestIPaddr,7,tcp_echoclient_connected);
}
else
{
SerialPrint("not null");
memp_free(MEMP_TCP_PCB, echoclient_pcb);
}
}
question from:
https://stackoverflow.com/questions/65939519/tcp-retransmition 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…