Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Mar : [Q] Bind to local adapter IPs (Usage of TIdHTTP/TCPClient)
| Subject: | [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 17:24:55 |
OK,
here's my Problem:
I have several RAS-adapters in my system - each adapter has a different IP.
I must use each adapter (one after another) to surf to the same site (IP).
This normally works - I just set BoundIP and BoundPortMin and BoundportMax.
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)
Now my question:
The options are called Boundportmin and ...max. But they seem not to have any effect,
if BoundIP is set. Indy always uses BoundPortMax and does no retries.
Because, if the socket is closed (but in half-open state) you get an exception "Adress
already in use...").
Must I really try/catch this exception around my Connect() call? And do the retries in my
code?
The same happens, if redirects (on a http1.0 connection) occur - indy tries to reconnect
(to connect to the new URL) - and bang: "Adress already in use"
How can I determine upfront if a socket is "half-open" (besides storing "my" used
portnumbers, because this tool will run in multiple instances...) ?
Any clues?
TIA
/Marc