|
From: | address@hidden |
Subject: | Re: [lwip-users] netconn_x API, Connecting a TCP client fails |
Date: | Tue, 09 Mar 2010 16:18:24 +0100 |
User-agent: | Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 |
Sägesser Walter wrote:
The problem you are seeing here is that TCP does not allow binding to a port twice. And although you called netconn_delete, the old port is still floating around (in TIME_WAIT state) for some minutes (this is a kind of safety implementation in TCP). You'd normally have three options here: - don't bind the netconn before connecting: your netconn will get an arbitrary local port assigned (your server has to cope with remote_port not being 9000 then, but that's normally not a problem) - use SO_REUSEADDR which allows binding if the other pcb is in TIME_WAIT - wait for some minutes before reconnecting Since SO_REUSEADDR is still not fully implemented, you can currently not use it, I guess, so you have only 2 options left. Simon |
[Prev in Thread] | Current Thread | [Next in Thread] |