Lwip webserver and tcp client at same time is posibble ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Lwip webserver and tcp client at same time is posibble ?

1,567 Views
ramazan_kurban3
Contributor III

Hi. I want to use lpcopen webserver app and tcpecho client app on LPC1769 board at the same time namely LPC1769 will act as both server and client.Is it posibble ? How can ı do ?

Tags (4)
0 Kudos
2 Replies

1,385 Views
danielchen
NXP TechSupport
NXP TechSupport

I would suggest you start with the demo lwip_httpsrv. Then add your tcp echo client code.

Please refer to lwip_httpsrv_freertos.c

/*!
 * @brief The main function containing server thread.
 */
static void main_thread(void *arg)
{
    LWIP_UNUSED_ARG(arg);

    stack_init();
    http_server_socket_init();

    vTaskDelete(NULL);
}

stack_init initialized the lwip stack; 

http_server_socket_init initialized the web server.

Then you can add your echo client function ( for example, tcpecho_client_init) from there.

Regards

Daniel

1,385 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Ramazan:

The device can act as both server and client. Because they running on different sockets.

Regards

Daniel

0 Kudos