This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C129XNCZAD: TCP Connection reset with TIRTOS Ethernet NDK library

Part Number: TM4C129XNCZAD

Hello,

We are using TI RTOS and NDK library for ethernet connection to the server. When doing the SSL handshake, the client (the device using TI RTOS) reset the connection after sending some packets to the server.

I want to add one more point in some network scenarios it works OK but on some different networks, it does not work.

I have attached the Wireshark log of the client device using NDK. Please suggest the possible solution to this issue.

WiresharkLog.zipThanks.

  • Hello Saleem,

    The wireshark log appears like the client is in the middle of a connect call. Is there an error code being returned by connect?

    Regards,

    Dalton

  • Hello,

    Yes it returns error code   -103

    We have tested multiple times and it always fails at the same point of a connect call.

    It should not be any firewall issue as packets are getting exchanged between client and server for the hello message. Is it correct?

     

    Thanks.

     

     

  • Saleem,

    Thanks for that update. That error corresponds to ECONNABORTED and should only be returned by accept() calls. Are you sure it did not come from that function? This return code has moved around in different sdk releases though. What version of the SDK are you using?

    Regards,

    Dalton

  • Hello,

    We are getting the error -103 from the below line in the funciton Ssock_send.

    else {
    nbytes = send(ssock->s, (void *)buf, ilen, flags);
    }

    sprsend calls the function Ssock_send. HTTPCli_sendRequest calls the function  sprsend.

    So we call the function HTTPCli_sendRequest  that at the calls Ssock_send which return -103.

    We are using the following versions.

    TI RTOS v2.16.01.14

    NDK v2.25.01.11

    WOLFSSL v3.9.10

     

    Thanks.

  • Hello Saleem,

    Ah I see. Can you modify your app too print out the return of fdError() after the -103 error is returned? The -103 error is telling us NDK's send() function failed somehow, fdError() can tell us exactly how send() failed.

    Also which HTTPCli_* function are you calling that is ultimately calling Ssock_send?

    Regards,

    Dalton

  • Hello,

    I have modified my application to display the return of fdError() after -103 error is returned. fdError returns a value 55.

    HTTPCli_sendRequest is the function that is ultimately calling Ssock_send.

    Thanks.

  • Hello Saleem,

    That error code means you are running out of socket buffers. That would explain why your app only works in some network environments. On the environments where your app doesn't work, there are probably a lot of broadcast messages being sent out, and those consume the buffers you need (they would get freed quickly, but if they come fast enough you won't have any buffers to use when you want to send). 

    You can configure how many buffers your app gets though. This page explains in detail how to do that. If you are using config all you need to do is edit or add this line in your *.cfg file

    Global.pktNumFrameBufs = 16; //increase this number until you stop getting 55 from fdError()

    Regards,

    Dalton