[ ]
 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Homepage FreeRTOS Labs FreeRTOS+TCP FreeRTOS+FAT Contact / Enquiries

FreeRTOS+TCP is still in the lab
FreeRTOS+TCP is already used in commercial products and we encourage you to try it yourself. Be aware however that we are still refining its design, and the source code and documentation do not yet meet Real Time Engineers Ltd's strict quality standards.
Please use the forum for support, feedback and ideas, or contact us directly if you have a specific business interest.


[FreeRTOS+TCP API Reference]

BaseType_t FreeRTOS_shutdown( Socket_t xSocket, BaseType_t xHow );

Disable reads and writes on a connected TCP socket. A connected TCP socket must be gracefully shut down before it can be closed.


xSocket   The socket being shut down.

xHow   Must be set to FREERTOS_SHUT_RDWR.

FreeRTOS+TCP does not currently use the xHow parameter as it always shuts down both reads and writes. xHow is included to ensure the function prototype conforms to the expected Berkeley sockets standard, and for compatibility with future FreeRTOS+TCP versions which may accept other parameter values.


If the shutdown request was successful then 0 is returned. The shutdown being complete is indicated by FreeRTOS_recv() calls on the socket resulting in FREERTOS_EINVAL being returned.

If xSocket is not a valid TCP socket then -pdFREERTOS_ERRNO_EOPNOTSUPP is returned.

If xSocket is a valid TCP socket but the socket is not connected to a remote socket then -pdFREERTOS_ERRNO_EOPNOTSUPP is returned.

Note that, because FreeRTOS does not implement errno, the behaviour in the presence of an error is necessarily different to that of connect() functions that are fully compliant with the expected Berkeley sockets behaviour.

Example usage:

The source code examples on both the Sending TCP Data and the Receiving TCP Data pages demonstrate a connected socket being shut down then closed.

[ Back to the top ]    [ About FreeRTOS ]    [ FreeRTOS Labs Sitemap ]    [ Main FreeRTOS Sitemap ]    [ ]

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.