Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Closing TCP Connection

Posted by saiberion on December 3, 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

RE: Closing TCP Connection

Posted by Patrick DEFLANDRE on December 4, 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...


RE: Closing TCP Connection

Posted by sotd on December 4, 2007
I think this is how HTTP 1.0 is defined to behave. HTTP 1.1 is different.

RE: Closing TCP Connection

Posted by saiberion on December 4, 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.

RE: Closing TCP Connection

Posted by sla on December 5, 2007
Did you try to comment

netconn_close( pxNetCon );


RE: Closing TCP Connection

Posted by saiberion on 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?

[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS v10.2.0 is available for immediate download. MIT licensed, and including RISC-V and ARMv8-M (Cortex-M33) demos.

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers





STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner