Lwip webserver and tcp client at same time is posibble ?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Lwip webserver and tcp client at same time is posibble ?

1,667 次查看
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 ?

标记 (4)
0 项奖励
回复
2 回复数

1,485 次查看
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,485 次查看
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 项奖励
回复