[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] Repeated tcp_bind calls

From: Russ Dill
Subject: [lwip-devel] Repeated tcp_bind calls
Date: Tue, 10 Jun 2014 05:32:26 -0700

I'm trying to reuse a port, but it looks like I'm having to wait for a
time wait timeout as tcp_bind returns an error.

My sequence is
listen {
lpcb = tcp_new
ip_set_option(lpcb, SOF_REUSEADDR)
tcp_bind(lpcb, addr, port)
lpcb = tcp_listen(lpcb)
tcp_accept(lpcb, accept)


accept(pcb) {

/* repeated accept calls don't make sense in out application, close
the listen pcb */
if (tcp_close(lpcb) < 0)

< talk on pcb, eventually close >

After a listen/accept cycle has happened and accept has closed its
pcb, I'll try calling listen again, but bind will give me a failure
until some timeout. Is there any way to get around this? I have
SO_REUSE defined.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]