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.

Maximum number of Connection for single TCP Socket

Other Parts Discussed in Thread: TM4C1294KCPDT

Hello,

I am currently working with TM4C1294KCPDT , i have created a TCP socket in server Mode and doing multiple connections of it simultaneously i.e with the same Socket number i can connect four different Client and transfer the data. Now can you please answer me that how many Maximum connection is possible for the same TCP socket and where it has declared.?

Thank you,

Rajani

  • Hello Rajani,

    I found the following from the "./third_party/lwip-1.4.1/src/include/lwip/opt.h" file of TivaWare. These values can be modified in the "lwipopts.h" file of the project.

    /**
     * MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections.
     * (requires the LWIP_TCP option)
     */
    #ifndef MEMP_NUM_TCP_PCB
    #define MEMP_NUM_TCP_PCB                5
    #endif
    
    /**
     * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections.
     * (requires the LWIP_TCP option)
     */
    #ifndef MEMP_NUM_TCP_PCB_LISTEN
    #define MEMP_NUM_TCP_PCB_LISTEN         8
    #endif

    The above code shows the default values. Since you are looking to modify the number of TCP sockets in listen mode, the value of "MEMP_NUM_TCP_PCB_LISTEN" should be redefined in "lwipopts.h" (of the project) to modify the value.

    Thanks,

    Sai

  • Hello,

    Thanks a lot Sai for you quick reply.

    Can you Please tell me that what would be the maximum number of connection   for same TCP Socket connected simultaneously.

    i.e   #define MEMP_NUM_TCP_PCB_LISTEN    X 

    here what could be the maximum value of X  ?

    Thanks,

    Rajani

  • Hello Rajani,

    That would depend on the system resources like how much RAM is available and the processing speed.

    The RAM calculation can be get pretty complex as one has to calculate the amount of RAM required by each listening connection and then look at the available RAM to deduce how many ports can be supported.

    From the processing speed side one has to look at how many connections will be opened simultaneously and how much processing would each open connection consume.

    I don't think it can be answered without looking at the whole system and even then it's hard to arrive at a theoretical value.

    Thanks,
    Sai