LwIP netconn problem s bind()
Stano
stano.hw na gmail.com
Středa Duben 30 16:05:24 CEST 2014
Zdravim konferenci, mam nasledovny kusok kodu:
conn_data = netconn_new(NETCONN_TCP);
err = netconn_bind(conn_data, NULL, PORT);
if (err == ERR_OK){
accept_err = netconn_accept(conn_data, &newconn);
serve_connection(newcon);
netconn_close(newconn);
netconn_delete(newconn);
}
netconn_close(conn_data);
netconn_delete(conn_data);
Otvori to TCP port a caka na spojenie, ked sa prenesu data port sa
zatvori a connection sa maze.
Problem je v tom ze po zmazani uz 2hy krat netconn_bind() nevrati OK
Docital som sa na strankach LwIP:
"Bind a netconn to a local IP address or to any IP address. Note that if
you try to bind the same address and/or port you might get an error
(ERR_USE, address in use), even if you delete the netconn. Only after
some time (minutes) the resources are completely cleared in the
underlying stack due to the need to follow the TCP specification and go
through the TCP timewait state."
Vie niekto poradit ako tento problem spravne vyriesit? Napada ma
nastavit velmi maly timeout ale to mi pride ako velmi spinave riesenie.
Dakujem za kazdu radu
S pozdravom
Stano
Další informace o konferenci Hw-list