Hello,
I am using cortex M-3 lm3S6965 controller where I am writing application as Modbus tcp client and server using lwip:
1. it has one tcp server which listen on port 502 & it works on Modbus protocol. 2. one tcp client which tries to connect 4-5 different tcp server one after another, i.e. a. connect to one tcp server at a time b. send modbus query c. wait for response from server d. read response e. close connection f. repeat steps a-e for all server
3. when I try to access my server port 502 from outside, it gets connected. 4. My client socket also connect to outside server.
But once my client socket starts communicating with the outside server(here I am using modsim32 in tcp server mode), then after I am unable to access my server socket(i.e. 502) unless & until I reset my board.
so what is the problem with client & server mode application on same machine... could any one plz help?
Thanks in advance.
so what is the problem with client & server mode application on same machine...
There is nothing wrong with that scenario on the same machine per se.
I use the Keil implementation of TCP stack and see no such problems. Even when I go past the Keil recommended limit of 20 concurrent TCP sessions (mixing both client and server) it works acceptably well.
So rather than assuming it's a machine problem, it might be better to check your code or lwip documentation.
Your code possibly calling non-reentrant code that should have been protected by a mutex?
Or your code possibly busy-looping, when it should have multiplexed to make sure other network conenctions also gets serviced?
My tcp client socket works absolutely fine(make and break tcp connection concept).
But for tcp server socket, it will works fine at beginning and then the lwip stack will disconnect this socket automatically after some time. It gives me "connection_abort" error.
How many sockets can lwip handle at a time? Is there any settings i have to make in lwip stack(i.e. parameters like TCP_WND, PBUF_POOL_SIZE, PBUF_POOL_BUFSIZE, etc)?
Could any one plz guide me?
Approx how many free KB are required for RAM/ROM memory to implement client & server on same machine?
I have debug my code & noticed that lwip stack is returning me ERR_ABRT error from tcp_abandon function.
So could you suggest me what wl be the problem?
I am also facing same issue. Have you got any solution on this?