- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Test on sdk3.0.1, with FreeRTOS+LwIP.
Below code snip shows wiced_tcp_create_socket fails if i >= 5.
The fail result is 25 (SOCKET_CREATE_FAIL).
Which means I can only successfully create 5 sockets at the same time. (0 ~ 4).
for (i = 0; i < 10; i ++) {
result = wiced_tcp_create_socket(&socket, WICED_STA_INTERFACE);
if (result != WICED_SUCCESS) {
WPRINT_APP_INFO(("wiced_tcp_create_socket fails %u i=%d\r\n", result , i));
}
}
So any limitation about the number of sockets can be created at the same time?
Solved! Go to Solution.
- Labels:
-
TCPIP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sam Lin,
Also change the following to the number of sockets required
MEMP_NUM_TCP_PCB and MEMP_NUM_UDP_PCB in opt.h
/**
* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
* per active UDP "connection".
* (requires the LWIP_UDP option)
*/
#ifndef MEMP_NUM_UDP_PCB
#define MEMP_NUM_UDP_PCB 10
#endif
/**
* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections.
* (requires the LWIP_TCP option)
*/
#ifndef MEMP_NUM_TCP_PCB
#define MEMP_NUM_TCP_PCB 10
#endif
Let me know if you face any issues.
thnx
vik86
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
LWIP uses pre-allocated pool.
The fixed sized is controlled by a variable. We may need to change the configuration to allow more than 5.
In lwipopts.h check, MEMP_NUM_NETCONN is defined to be 8, if you increase this, does this allow you to have more?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi gangi,
Below code always fails at "i = 5 , result=25".
int i;
for (i = 0; i < 10; i ++) {
wiced_result_t result = wiced_tcp_create_socket(&test_socket, WICED_STA_INTERFACE);
if (result != WICED_SUCCESS) {
WPRINT_APP_INFO(("i = %d , result=%u\r\n", i , result));
break;
}
}
I have changed MEMP_NUM_NETCONN to 16, but the test result is still the same.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you confirm this is still an issue in SDK 3.1.0?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Gangi,
I just test again with sdk 3.1.0 and still hit this issue with exactly the same result.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for confirming.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sam Lin,
Also change the following to the number of sockets required
MEMP_NUM_TCP_PCB and MEMP_NUM_UDP_PCB in opt.h
/**
* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
* per active UDP "connection".
* (requires the LWIP_UDP option)
*/
#ifndef MEMP_NUM_UDP_PCB
#define MEMP_NUM_UDP_PCB 10
#endif
/**
* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections.
* (requires the LWIP_TCP option)
*/
#ifndef MEMP_NUM_TCP_PCB
#define MEMP_NUM_TCP_PCB 10
#endif
Let me know if you face any issues.
thnx
vik86
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi vik86,
yes, that is the setting we are looking for.
BTW, do you have document about adjusting these settings in WICED-SDK?
Some settings a not very trivial, for example,
I'd like to know how to set MEM_SIZE setting in
WICED/network/LwIP/ver1.4.0.rc1/src/include/lwip/opt.h
And also how to set proper value for LWIP_NUM_PACKET_BUFFERS_IN_POOL.
(My question is how to calculate the *proper value* we need?)
thanks.