lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Raw TCP Client and Server NO_SYS


From: yasir arafat
Subject: Re: [lwip-users] Raw TCP Client and Server NO_SYS
Date: Mon, 3 Jun 2019 12:26:09 +0530

In a very similar problem I endup corrupting tcp_active_pcbs in circular linked list. After hard debugging I found that mem_free() called twice for a single connection to free a closing connection. 

On Mon, 3 Jun, 2019, 3:55 AM Pedro, <address@hidden> wrote:
Hello there, how are you?

Well, I'm working with a STM32H7 board and lwIP stack (2.0.3), no RTOS. The idea is running a TCP Client and a TCP Server at the same time, so I've started using echo demos as reference. TCP Client can use an IP address or a host name, so "dns_gethostbyname" is helping me. Also, I've set TCP_SYNMAXRTX to 3, so if no Server is found, "tcp_err" is called to close the client and then, try again later ("tcp_new").

To test the routine, I've provided a simple terminal on my Windows, with both TCP Client and Server functions. So if I type the board IP address and Port, I can connect to lwIP Server. And if I opens a Port, lwIP Client connects to it.

Everything works fine if lwIP Client connects first. If lwIP Server gets a connection first or even if Windows server is offline, the board get stucked on "tcp_fasttmr" method, with "pcb" and "pcb->next" pointing to the same address (established Server).

I've created some kind of state machine for both connection, running on main while, so I can't see any concurrent process (maybe SYNC by lwIP and the Server stack?).

Do you have any clue how can I solve this? I'm planning to add more functions to my board, something close to Microchip TCPIP stack, with HTTP server, DDNS and NTP clients.

Thanks a lot!
_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users

reply via email to

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