FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [June 2017 Threads]
Hello!
Does I understed correct after FreeRTOSclosesocket() (for example when connection is lost) I must to create new socket with FreeRTOSsocket() to reopen connection, and I must not to use old socket value. Does this kind of socket creation uses dinamic memory allocation even I need only one open socket? Does it could couse memory fragmentation if I use heap_1?
Regards,
Vasilij
Once a socket is closed it cannot be used again. If you want another
socket then you need to create it again.
The socket is allocated using a call to pvPortMallocSocket(). By
default that will call pvPortMalloc(), but you can re-define the
behaviour by #defining pvPortMallocSocket() in FreeRTOSIPConfig.h to do
whatever you want it to do. Fro example:
define pvPortMallocSocket( x ) MyStaticAllocator( x )
(where MyStaticAllocator() would be something you provided).
heap1 cannot free memory, so don't use that. Heap4 will guard against
memory fragmentation as much as it can.
Thank you a lot for explanation! It helped.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.