Not logged in. · Lost password · Register
Forum: agsXMPP RSS
ejabberd on local with Psi, no problem, but with the library, connection refused?!
Avatar
BinaryDialog #1
User title: http://www.codeplex.com/BinaryDialog
Member since Mar 2008 · 4 posts · Location: Nogent sur Marne
Group memberships: Members
Show profile · Link to this post
Subject: Server refuse my connection!
Hello,

when i try to connect on my local server (ejabberd) with Psi, the connection is perfect but with the library, unable to connect!!!!!!
Server return: Connection refused. Why?!
I tried to use with autoresolve, same error returned.

If you've got an idea..... Me in the fog! lol


Thank you very much, i need ejabberd 2.0 to develop pubsub methods! :/
BinaryDialog - BiLog IM
WPF Client for XMPP Protocol
Using agsXMPP Library! (The most powerfull XMPP library for dotNet applications!)

http://www.codeplex.com/BinaryDialog
http://microphage71.hostarea.org
Avatar
Alex #2
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
There should be no problem to connect to your local server if the domain is correct.
ipv6 could be a problem when your local machine is configured to ipv6 also and the server is listening only to ipv4 ips.

Alex
Avatar
BinaryDialog #3
User title: http://www.codeplex.com/BinaryDialog
Member since Mar 2008 · 4 posts · Location: Nogent sur Marne
Group memberships: Members
Show profile · Link to this post
yes... ipv6 , my os is vista and ipv6 is a problem. i try to desactivate ipv6. good idea.
BinaryDialog - BiLog IM
WPF Client for XMPP Protocol
Using agsXMPP Library! (The most powerfull XMPP library for dotNet applications!)

http://www.codeplex.com/BinaryDialog
http://microphage71.hostarea.org
Avatar
Alex #4
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
or change ejabberd to listen on your ipv6 ip.
Avatar
BinaryDialog #5
User title: http://www.codeplex.com/BinaryDialog
Member since Mar 2008 · 4 posts · Location: Nogent sur Marne
Group memberships: Members
Show profile · Link to this post
In reply to post #3
in net/ClientSocket.cs, i read:
#if NET_2
                // IPV6 Support for .NET 2.0
                if (Socket.OSSupportsIPv6 && (endPoint.AddressFamily == AddressFamily.InterNetworkV6))
                {
                    Debug.WriteLine("IPV6");
                    _socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp);                  
                }
                else
                {
                    Debug.WriteLine("IPV4");
                    _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                }
#elif NET_11    
                // IPV6 Support for .NET 1.1
                if (Socket.SupportsIPv6 && (endPoint.AddressFamily == AddressFamily.InterNetworkV6))
                {
                    Debug.WriteLine("IPV6");
                    _socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp);                  
                }
                else
                {
                    Debug.WriteLine("IPV4");
                    _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                }
#else
                // CF, there is no IPV6 support yet
                Debug.WriteLine("IPV4");
                _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
#endif

okay very good, but if you add a propertie to select ipv6 or ipv4 to force socket adressfamily type? Propertie appear when .net 1.1 or 2.0 or later.
no?
private _forceIpv4 = false;
#if NET_11 || NET_2
public bool forceIpv4
{
 get { return _forceIpv4; }
 set
 {
  _forceIpv4 = value;
  if(!_forceIpv4 && !Socket.OSSupportsIPv6) { _forceIpv4 = true; }
 }
}

#endif

after:
#if NET_2
                // IPV6 Support for .NET 2.0
                if (Socket.OSSupportsIPv6 && (endPoint.AddressFamily == AddressFamily.InterNetworkV6) && !_forceIpv4)
                {
                    Debug.WriteLine("IPV6");
                    _socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp);                  
                }
                else
                {
                    Debug.WriteLine("IPV4");
                    _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                }
#elif NET_11    
                // IPV6 Support for .NET 1.1
                if (Socket.SupportsIPv6 && (endPoint.AddressFamily == AddressFamily.InterNetworkV6) && !_forceIpv4)
                {
                    Debug.WriteLine("IPV6");
                    _socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp);                  
                }
                else
                {
                    Debug.WriteLine("IPV4");
                    _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                }
#else
                // CF, there is no IPV6 support yet
                Debug.WriteLine("IPV4");
                _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
#endif
BinaryDialog - BiLog IM
WPF Client for XMPP Protocol
Using agsXMPP Library! (The most powerfull XMPP library for dotNet applications!)

http://www.codeplex.com/BinaryDialog
http://microphage71.hostarea.org
Avatar
Alex #6
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
The IP address gets resolved by dns. When dns returns a v4 address then ipv4 is used. When the dns returns a v6 address and the OS supports v6 then a v6 socket is created.
A property makes no sense here, because we have to connect to the ip we get from the dns server.
If it makes problems for you then set AutoResolveCOnnectServer = false and specify your v4 IP in the ConnectServer property.

Alex
Avatar
BinaryDialog #7
User title: http://www.codeplex.com/BinaryDialog
Member since Mar 2008 · 4 posts · Location: Nogent sur Marne
Group memberships: Members
Show profile · Link to this post
ha ha! okay now i understand. thank you.
BinaryDialog - BiLog IM
WPF Client for XMPP Protocol
Using agsXMPP Library! (The most powerfull XMPP library for dotNet applications!)

http://www.codeplex.com/BinaryDialog
http://microphage71.hostarea.org
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