Closing TCP Connection

saiberion wrote on Monday, December 03, 2007:

I know about this for some time but now I need to know why it is like that.

In the lwIP Rowley Demo project the TCP connection is closed by the controller after each receive. Is there a reason behind this behaviour?
The initial idea was that a PC application opens a TCP connection to the controller and keeps it open until it is closed by the application.

I’m using FreeRTOS 4.6.0 and lwIP 1.2.0 on a AT91SAM7X512

pdeflandre wrote on Tuesday, December 04, 2007:

Hello saiberion,

You are right. But this application is a special one : a web server. It wait for request, serve it, and close immediately the connection.

It is impossible to keep connection open with each client, as the number of possible client is quite infinite…

But I am not an expert in web server. I don’t have coded one…


sotd wrote on Tuesday, December 04, 2007:

I think this is how HTTP 1.0 is defined to behave.  HTTP 1.1 is different.

saiberion wrote on Tuesday, December 04, 2007:

For a web server this behaviour is OK.

But in my case I would like to have a connection-oriented communication.
I already tried to keep it running by out commenting netcon_delete but it didn’t work right for me or I forgot something.
And the number of connections to the controller is limited to 1 by design.

sla000 wrote on Wednesday, December 05, 2007:

Did you try to comment

netconn_close( pxNetCon );


saiberion wrote on Monday, December 10, 2007:

Yes I did with no success.
First communication packet is processed and atm it seems to me that the next packet doesn’t even reach the application.

Is there maybe an example how to handle connection oriented communication?