ABSTRACT

This chapter shows how to configure and use an open-source protocol stack, namely lwIP, which is capable of handling the ubiquitous TCP, UDP, and IP protocols, and how to interface it with the underlying real-time operating system. It addresses how to use the protocol stack effectively from the application tasks, by choosing the most suitable lwIP application programming interface depending on the applications at hand. The lwIP protocol stack is an open-source product that provides a lightweight implementation of TCP/IP and related protocols. The two configuration options lwIP_SO_RCVTIMEO and lwIP_SO_RCVBUF determine the availability of two socket options used to specify a timeout for blocking receive primitives and to indicate the amount of receive buffer space to be assigned to a socket. If the lwIP configuration option TCP_LISTEN_BACKLOG has been set, the function netconn_listen_with_backlog performs the same action and it allows the caller to specify the size of the connection backlog associated to the endpoint.