Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

lwip raw api -> tcp_connect

hi,

I use the standalone lwip example from the download area here, it works fine with the webserver example. Now i am writing my own application and i need to do an active open (tcp_connect) to a server.

When my application sends the "SYN" flag, the Server answeres very fast with "SYN ACK" flag (thats normal)

-> now my application needs exactly 2,5 seconds to answere with a "ACK" flag and i don' know why it takes soooooo long. i i can't find the error.

Heres my code :

void test_init(void)

{

struct ip_addr ipa;

struct tcp_pcb *pcb2;

u16_t port;

err_t error;

port = 21;

IP4_ADDR( &ipa, 192, 168, 1, 50 );

pcb2 = tcp_new();

tcp_bind(pcb2, IP_ADDR_ANY, 1362);

error = tcp_connect(pcb2,&ipa,port,ftp_connect);

}

P.S. i didn't changed the lwip_web_server.c . i just replaced the httpd_init() call with the test_init() call

Thx for your help
No RepliesBe the first to reply