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.

listen(sd, backlog) - The backlog argument

I have some problem with my HTTP-server that is based around a CC3000 module.

Today when I looked through the documentation and really tried to understand your implementation of how sockets should bee handled I came a cross the listen-function.

In your doxygen:

http://software-dl.ti.com/ecs/simplelink/cc3000/public/doxygen_API/v1.11.1/html/index.html

Look at the listen funktion, it says:

"[in] backlog specifies the listen queue depth. On this version backlog is not supported."

Ok, so backlog is not implemented, fine. However, if you look here at your HTTP-server example:

http://processors.wiki.ti.com/index.php/CC3000_HTTP_Server_Demo_Session

There are two lines:

listen (httpServerSocket, MAX_CLIENTS)

and

listen (httpServerSocket, 5)

To me this clearly indicates that the second argument, backlog, has a meaning, or at least the TI-guy that wrote that code think so...

Moreover, I understand that the CC3000 can handle 4 connection, but it can handle 5 backloged connections?

So my questions are, does the backlog-argument effect my code in any way, and if it does, is it really possible for the CC3000 chip to handle 5 backlloged connections?

Thanks,

/Per



  • Hi,

    As suggested by the API documentation, the backlog is not supported for listen. CC3000 can support a maximum of 4 sockets.
    Let me check why this is called in the HTTP server example.

    Regards,
    Raghavendra
  • Hi,
    Any more information on the backlog argument?
    Regards,
    Per
  • Download the PatchProgrammer-1.14.7.16.32.
    Locate the socket.h file.
    Look at line 98 and you will find:
    #define MAX_LISTEN_QUEUE 4

    Now, find the socket.c file.
    Line 427 says:
    args = UINT32_TO_STREAM(args, backlog);

    I understand that the code above could be for "future use", and that the CC3000 is ignoring the backlog.
    However, it is a bit confusing when you see stuff like this in the code, and in your own example but the documentations says it is not implemented. Since the doxygen documentation you are supplying is really old, I prefer to look at the code...