Maximum load for 2 connections causes 1 connectino to drop (TCP/IP) RTCS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Maximum load for 2 connections causes 1 connectino to drop (TCP/IP) RTCS

582 Views
petermai
Contributor I

Hello everybody, 

see the headline. If I do a maximum load for 2 connections, one connection drops. And which connection drops seems to follow some rule I do not understand. It works fine if I reduce the load. 

 
Anybody has an idea?

Briefly:
The sockets are configured as stream sockets:

       sockets.sock4_tcp_handle = socket(PF_INET, SOCK_STREAM, 0);
and do listen via:

      u32Error = listen(sockets.sock4_tcp_handle, 0);
An accept creates a new child socket:

      au32ETHSock[tcp_u8FreeToUseConnectionID] = accept(sockets.sock4_tcp_handle, NULL, NULL);

And then a new task is created for this socket ..........

Every task is in a while(1) loop with a unique u32NewSocket_handle and a unique pau8RecvBufferTCP

      while(1)

      {
         u32NumOfRecvByte = recv(u32NewSocket_handle, pau8RecvBufferTCP, ETHBUFFER_SIZE,          MSG_DONTWAIT);
      }

Thank you very much for your help!

Tags (5)
0 Kudos
1 Reply

498 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Peter:

Maybe this issue is related to memory.  You can increase the socket buffer size  to get better performance, specify the size of the send and receive buffers to be multiples of the maximum packet size,  but this will consume more memory, you need to weigh the pros and cons.

E.g. uint_32 value; …  value = 2048; setsockopt(sock, SOL_TCP,OPT_TBSIZE,&value,sizeof(value));  setsockopt(sock, SOL_TCP,OPT_RBSIZE,&value,sizeof(value)); 

Another parameter you can increase is _RTCSPCB_max, it represents the number of packets you want RTCS to handle at any given time.

Have a great day,
Daniel

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button or helpful. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos