TCPIP error RTCSERR_TCPIP_NO_BUFFS 0x1612

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

TCPIP error RTCSERR_TCPIP_NO_BUFFS 0x1612

528 Views
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;

}

Labels (1)
0 Kudos
2 Replies

301 Views
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 Kudos

301 Views
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 Kudos