Re: ipv6 considerations

Peter Deacon <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <alpine.WNT.2.00.1108190820270.2200@SMURF>
On Fri, 19 Aug 2011, Frediano Ziglio wrote:

> Mmm... I'm just thinking about using getaddrinfo/getnameinfo and
> similar in libtds avoiding other "old" functions like gethostbyname
> and implementing getaddrinfo replacements where not available.

Hi Freddy,

I like the idea.  If you are starting from the old IPv6 patch..

Was thinking instead of hacking tds_open_socket to try each address it 
would be better to add an addrinfo field to tds_open_socket and call it 
once for each entry until a connection is made or the linked list is 
exhausted.  (example rename tds_open_socket to tds_open_socket_addr and 
make tds_open_socket just handle iterating getaddrinfo calls)


With multiple addresses there are some problems:

The connection level timeout should apply to each address attempted but 
some may want to also be able to constrain the overall time it takes to 
connect.

The better picks based on IPv6 RFC / local policy will be first in the 
linked list however the error message returned via the old patch is always 
from the last attempt.

Some scheme where the first error tried on the list is remembered as long 
as failure reason is not connection refused or no route to host would be 
ideal as it stands a better chance of reporting the connection error for 
the most useful/salient host to the user...or multiple error records?

Let me know if you want any help.

regards,
Peter
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.