Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Mar : Re: [Q] Bind to local adapter IPs (Usage of TIdHTTP/TCPClient)
| Subject: | Re: [Q] Bind to local adapter IPs (Usage of TIdHTTP/TCPClient) |
| Posted by: | "Marc Wetzel" (mwse_n_o_s_p_a..@gmx.de) |
| Date: | Mon, 20 Mar 2006 21:08:59 |
Remy Lebeau (TeamB) schrieb:
> "Marc Wetzel" <mwse_n_o_s_p_a_m@gmx.de> wrote in message
> news:441ed755$1@newsgroups.borland.com...
>
>> And I can surf... but if I surf "to quickly" the socket will not be closed
>> (but I really closed it - it is now in a so called half-open state,
> because
>> windows still wants to receive data, which might arrive after the FIN is
> sent)
>
> That is perfectly fine, because the half-open socket is bound to a different
> adapter. When you switch adapters for the next socket, you should be able
> to open it immediately, even if the previous one is still open. A socket is
> identified by the IP/port combinations that it is bound to, and you are
> changing those values each time.
>
Yes sure - that is not the problem at all.
For example:
My loop looks like that:
while running do
begin
for i := 0 to adapter_count do
DownloadWebpage(i,SourceIP[i],DestinationIP);
Log('Inner Loop ends');
end
Log:
Program started.
Adapter-0 => WORKS (Time: 0.6 seconds)
Adapter-1 => WORKS (Time: 0.5 seconds)
Adapter-2 => WORKS (Time: 0.7 seconds)
Inner Loop ends
Adapter-0 => ERROR (EADDRINUSE)
Adapter-1 => ERROR (EADDRINUSE)
Adapter-2 => ERROR (EADDRINUSE)
...
this continues for about 60 seconds, then it will work again one time and so on
Best regards
Marc
none