Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12747 Discussions

LWIP number of socket connections Issue

Altera_Forum
Honored Contributor II
1,233 Views

Hi Everyone, 

 

I am writing a client server implementation of sockets using LWIP. I can successfully connect 3 clients to the server and send/receive data. When I try and connect a 4th client, the 4th client appears like it has connected but crashes immediately. On the server end the server appears not to have accepted the 4th connection (from my debug data). 

 

When the server starts it creates a new task called ManageConnectionsTask using sys_thread_new. My server waits for incoming connection requests and then creates a new "read" task based on each incoming connection requests, I also tried switching to a new port but no joy. Is there a limit on how many connections a server can spin off? Has anyone had a similar issue? 

 

ManageConnectionsTask() 

socket() 

bind() 

listen() 

 

while (true) 

{  

accept(pNetworkManager->fd_socket, ..); 

 

if(!sys_thread_new(ReadSocketTask, &(pNetworkManager->client_sockfd),  

(READ_CONN_PRIORITY + nPriorityOffset))) 

DieWithError("ManageConnectionsTask: Can't create ReadSocketTask!\n");  

 

. .. 

 

Cheers, 

 

Aiden
0 Kudos
0 Replies
Reply