Not logged in. · Lost password · Register
Forum: agsXMPP SDK Support RSS
Avatar
tbraun #1
Member since Jan 2008 · 3 posts
Group memberships: Members
Show profile · Link to this post
Subject: agsXMPP doesn't properly obtain server IP address
When going through some initial library tests, the client fails to connect to our server due to the automatic use of the first resolved ip address.  The client is running on Windows Vista with IPv6 enabled.  The first returned address for the server, which is running on the same machine as the client, is an IPv6 address.  The server does not listen on IPv6 addresses, therefore the connection fails. 

To properly resolve the server ip address, I had to make the following change at line 207 in ClientSocket.cs.

                IPAddress ipAddress = null;

                foreach (IPAddress address in ipHostInfo.AddressList)
                {
                    if (address.AddressFamily == AddressFamily.InterNetwork)
                    {
                        ipAddress = address;
                        break;
                    }
                }
Avatar
tbraun #2
Member since Jan 2008 · 3 posts
Group memberships: Members
Show profile · Link to this post
I would like to note that the SDK does properly obtain an address, but it doesn't account for the fact the IPv6 addresses exist and aren't readily supported yet.  So my initial subject may be misleading.
Avatar
Alex #3
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
hi tbraun,

ipv6 is supported, you will see some IP-V6 code in ClientSocket.cs when using the latest .NET2 version.

But i think you are hitting an edge case here because you run the server on your local machine. The DNS resolver returns your ipv6 address and the server is listening only for ipv4.
I don't think this will happen in real deployments.

But we are open to all suggestions to improve this behavior if there are problems.

Alex
Alexander Gnauck
AG-Software
Avatar
tbraun #4
Member since Jan 2008 · 3 posts
Group memberships: Members
Show profile · Link to this post
First off, thank you for the quick reply.  I wasn't expecting a response so fast.

I noticed the IPv6 code a few lines after my quick patch, which basically removes IPv6 support, but it works for now.  I think a public property along the lines of "PreferIPv4Host" would be nice as it would allow for us to programatically choose one address family or the other.  If you would like, I can throw together a patch and post it here.

Again, thanks for the quick response.

--Tim
Avatar
Alex #5
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
yes this would be very cool.
We have made all our ipv6 tests on a xp machine with enabled ipv6 support and Parallels with a virtual ipv6 network.

The only public ipv6 enabled servers are the once of amessage.de. But I had no luck to connect to them with ipv6. I think my router is ipv4 only or my ISP does not allow me to connect to ipv6 addresses.

Alex
Alexander Gnauck
AG-Software
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP SDK Support RSS