TCPIP error RTCSERR_TCPIP_NO_BUFFS 0x1612

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

TCPIP error RTCSERR_TCPIP_NO_BUFFS 0x1612

542 次查看
kaspergermannol
Contributor I

I working with a Kinetis MK60DN512VLQ10 and using MQX. I have made a HTTP client there is connecting to the HTTP Server every 60 sec. After about 200 connect/disconnect ~ 3 hours, I am getting the error RTCSERR_TCPIP_NO_BUFFS 0x1612.

From the release note of latest MQX, I can see that this is a known problem, but there is no solution. I think this is a BIG problem. Can somebody help or have a solution?

This is a part of my code:

//Create the stream socket for the TCP connection

sock = socket(AF_INET, SOCK_STREAM, 0);

if (sock == RTCS_SOCKET_ERROR)

{
   printf("Error creating socket\n\r");

   return NULL;

}

//Set socket properties for binding

localaddr.sin_family      = AF_INET;

localaddr.sin_port        = 0;

localaddr.sin_addr.s_addr = INADDR_ANY;

//Binding socket

result = bind(sock, &localaddr, sizeof(localaddr));

if (result != RTCS_OK)

{

   printf("Error binding socket\n\r");

   return NULL;

}

//Connect socket

result = connect(sock, &addr, sizeof(addr));

if (result != RTCS_OK)

{

   if (result == RTCSERR_TCPIP_NO_BUFFS)

   {

      //HERE IS MY PROBLEM!!!!

   }                                                   

   return NULL;

}

标签 (1)
标记 (2)
0 项奖励
2 回复数

315 次查看
karelm_
Contributor IV

Hi,

this error indicates that memory allocation failed during TCP open. So there is no available memory in your application. This might indicate memory leak. Please make sure you close the socket with shutdown function after you are done with communication.

Best regards,

Karel

0 项奖励

315 次查看
kaspergermannol
Contributor I

Hi Karel,

Thank you for your answer. I am already closing my socket with shutdown and it does not make any different.

//Shutting down connection to server

result = shutdown(sock, FLAG_CLOSE_TX);

Best regards

Kasper

0 项奖励