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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

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

783 次查看
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!

标记 (5)
0 项奖励
回复
1 回复

699 次查看
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 项奖励
回复