Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Socket exception
Avatar
Coder2010 #1
Member since Jun 2010 · 4 posts
Group memberships: Members
Show profile · Link to this post
Subject: Login doesn't work after .Net 4
Hi there,

I use agsXmpp 1.1.0.0 dll from a C# winforms solution containing multiple projects.
After recently upgrading (most of) those projects to target runtime .Net 4 in VS.Net 2010, the code to login to the XMPP server no longer works.

The error in the logs is:

xmppCon_OnSocketError(): Exception is - The requested name is valid and was found in the database, but it does not have the correct associated data being resolved forSystem.Net.Sockets.SocketException (0x80004005): The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for
   at System.Net.Dns.InternalGetHostByAddress(IPAddress address, Boolean includeIPv6)
   at System.Net.Dns.GetHostEntry(String hostNameOrAddress)
   at agsXMPP.net.ClientSocket.Connect()

I suspect this is due to my move to .Net 4 causing issues like that described here with agsXMPP:
http://connect.microsoft.com/VisualStudio/feedback/details…

Are there any plans to release a new build of agsXMPP.dll that will resolve this error?

Thank you

C2010
Avatar
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Are you running the latest svn code?
Are you using IP addresses instead of domains for the XMPP server domain?

Alex
Avatar
Coder2010 #3
Member since Jun 2010 · 4 posts
Group memberships: Members
Show profile · Link to this post
Hi Alex,

Thank you for the reply. 

No, I am not running the latest SVN - I couldn't download it as I am getting connection errors at svn://svn.ag-software.de/.  Is it available elsewhere?

Yes, we are typically using IP addresses to log in as the server is in a different domain.  (I haven't tried adding it to the Windows hosts file, I will do this tomorrow, maybe it might make a difference)

I was able to login after rebuilding the agsxmpp code solution with a different compile flag so that it does not evaluate as NET_2 i.e. the login method in CLientSOcket.cs used .Resolve() instead of GetHostEntry().  But at runtime I encountered errors in XmppOnMessage and XmppOnRosterItem, I think they were to do with the .Item property.  Sorry, I am remote at the moment and don't have the code with me, this is from memory.  I guess the source code I have is different from the compiled dll I was using previously.

Best regards and thanks again

C2010
Avatar
Alex #4
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by Coder2010:
No, I am not running the latest SVN - I couldn't download it as I am getting connection errors at svn://svn.ag-software.de/.  Is it available elsewhere?
the SVN is up and running at: svn://svn.ag-software.de/agsxmpp

Quote by Coder2010:
Yes, we are typically using IP addresses to log in as the server is in a different domain.  (I haven't tried adding it to the Windows hosts file, I will do this tomorrow, maybe it might make a difference)
this is not a good idea. Xmpp is a domain based protocol and you should always use domains, no IP addresses.

Quote by Coder2010:
I was able to login after rebuilding the agsxmpp code solution with a different compile flag so that it does not evaluate as NET_2 i.e. the login method in CLientSOcket.cs used .Resolve() instead of GetHostEntry().  But at runtime I encountered errors in XmppOnMessage and XmppOnRosterItem, I think they were to do with the .Item property.  Sorry, I am remote at the moment and don't have the code with me, this is from memory.  I guess the source code I have is different from the compiled dll I was using previously.

Anyway, fixing this is very easy. There should be first a check if the domain is an IP addres with IPAddress.TryParse. And only resolve via Dns if we have not already a domain.
BTW, the latest sources already use GetHostEntry().

Alex
Avatar
Coder2010 #5
Member since Jun 2010 · 4 posts
Group memberships: Members
Show profile · Link to this post
Thanks again Alex for the info.

Strangely I cannot access your SVN but I will try again later from a different location.

To fix the current issue I will just enforce the use of domain/server names as you recommend and avoid using IP addresses.

Best regards...
Avatar
Alex #6
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Are you using a SVN client or do you try to access the URL with a web browser?
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 RSS