Table of Contents
tcp_arg() -- Set the application connection state

The configuration option CYGFUN_LWIP_EVENT_CALLBACK defaults to enabled. If enabled then program execution is driven by callbacks. Each callback is an ordinary C function that is called from within the TCP/IP code. Every callback function is passed the current TCP or UDP connection state as an argument. Also, in order to be able to keep program specific state, the callback functions are called with a program specified argument that is independent of the TCP/IP state.

If the CYGFUN_LWIP_EVENT_CALLBACK option is disabled then a common user-supplied function is called from within the TCP/IP code instead of the respective callback routine:

err_t lwip_tcp_event(void *arg, struct tcp_pcb *pcb, enumlwip_event, struct pbuf *p, u16_tsize, err_terr);

For the individual callbacks or the shared lwip_tcp_event() the tcp_arg() function is used for setting the private arg application connection state.

Documentation license for this page: eCosPro License