Multiple netconn udp connection problem

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple netconn udp connection problem

anmk
Hi all,
I'm working on a project that I should send received UARTs data on related
udp sockets. I receive UART data on 6 interface (for example UART1 to 6) and
I want to send received data to udp port 1001 to 1006 (respectively).  I'm
using FreeRTOS version 9 and LwIP version 1.4.1. and udp socket type of my
board is server and PC is client.

I can receive data on all uarts successfully. so uarts are not my problem.
for testing my udp sockets, i create them one after another (that is I
create first socket and test it and then adding second socket and test it
and so on) and test the created socket with pc. for first four udp socket,
every thing is ok and my code is working well. but after adding fifth
socket, I have null pointer in return of "netconn_new(NETCONN_UDP)" function
and my code doesn't work.

what is the problem?
my lwipopts.h is in the attachment.


lwipopts.h <http://lwip.100.n7.nabble.com/file/t1788/lwipopts.h>  



--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: Multiple netconn udp connection problem

goldsimon@gmx.de
On 25.11.2018 19:03, anmk wrote:
> [..] after adding fifth
> socket, I have null pointer in return of "netconn_new(NETCONN_UDP)" function
> and my code doesn't work.
>
> what is the problem?

Have a look at lwip_stats. The 'err' members might tell you if you are
running short of memory.

Simon

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: Multiple netconn udp connection problem

anmk
Hi Simon,
Thank you very much for your reply.
I found what is the reason of my problem. It was because of MEMP_NUM_UDP_PCB value.
by default the value of MEMP_NUM_UDP_PCB is 4 and I need 6 socket. so I changed the value to 6
and my problem was solved.


On Sun, Nov 25, 2018 at 11:01 PM [hidden email] <[hidden email]> wrote:
On 25.11.2018 19:03, anmk wrote:
> [..] after adding fifth
> socket, I have null pointer in return of "netconn_new(NETCONN_UDP)" function
> and my code doesn't work.
>
> what is the problem?

Have a look at lwip_stats. The 'err' members might tell you if you are
running short of memory.

Simon

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users


--
---------------------------
Best Regards.
Abbas Nozari.

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users