# Lost in Sockets

**URL:** <https://forums.freertos.org/t/lost-in-sockets/7616>\
**Category:** Kernel\
**Created:** [January 10, 2019, 3:04pm UTC](https://forums.freertos.org/t/lost-in-sockets/7616 "2019-01-10T15:04:27Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [January 10, 2019, 3:16pm UTC](https://forums.freertos.org/t/lost-in-sockets/7616/2 "2019-01-10T15:16:38Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Thursday, January 10, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/f19c5876f8/#35b2/2d54):

Looking at the FreeRTOS\_socket() function (which you have the source  
code for, and can step through in the debugger), it seems like the only  
reasons FREERTOS\_INVALID\_SOCKET would get returned are:

1. prvDetermineSocketSize() fails. You can look through this function  
to see the reasons this could fail - basically network is not ready or  
an input parameter is wrong.

2. The socket structure cannot be created (is pvPortMallocSocket() just  
mapped to pvPortMalloc(), which is the default? If so, which memory  
allocater are you using? Heap\_1, heap\_2, etc.)

3. xEventGroupCreate() fails, which again is just a memory allocation,  
so same as #2.

---

_[View the full topic](https://forums.freertos.org/t/lost-in-sockets/7616)._
