Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
vicmanfran #1
Member since Dec 2011 · 5 posts
Group memberships: Members
Show profile · Link to this post
Subject: PDM.DNS QUERY Kaspersky Antivirus 2012
Hi I was testing agsXMPP on my .net application and there is an issue with Kaspersky Antivirus 2012. When you connect to the jabber server with the ip address and the property AutoResolveConnectServer(false) a WARNING popup appears and says that the application is detected as PDM.DNS QUERY.

Maybe you have to change the way of resolving hostnames, the library netlib.dns.dll works well but I dont know if you can fix this :)

Thanks.
Avatar
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I don't know if you pass a hostname or a Ip adress. So I always try to resolve the ip address with the .NET DNS classes. I don't consider this as a bug and see no problem here. XMPP normally needs always DNS resolving.

Alex
Avatar
vicmanfran #3
Member since Dec 2011 · 5 posts
Group memberships: Members
Show profile · Link to this post
I made a research about this strange behavior and according to Kaspersky the popup is usually shown when the dns packets carry extra information (not just requests to resolve the name). Maybe Microsoft missed up something with the lookup process because if I make a simple resolution with WebRequest, System.Net.Dns.GetHostEntry() or System.Net.Dns.GetHostAddress() the warning is also shown but if I pass an ip address the warning dissapears.

I think that this can also be a bug of the antivirus company but because many computers comes with that it could be a problem. It would be nice for agsXMPP users and developers to detect if the ConnectServer is already solved.

Thanks.
Avatar
Alex #4
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by vicmanfran:
It would be nice for agsXMPP users and developers to detect if the ConnectServer is already solved.

I have never seen an production software using ip addresses. This is also a bad idea because ip addresses can change, and this is the reason why we have DNS.

You can try MatriX, it checks if the syntax fits a v4 or v6 address and does no resolving in this case.

Alex
Avatar
vicmanfran #5
Member since Dec 2011 · 5 posts
Group memberships: Members
Show profile · Link to this post
Im running the Miniclient sample to test Matrix SDK but when I click Connect an Exception is thrown. I dont know if there is something wrong with the version 1.4.4.0 of the library. This is the MD5 checksum 5526C696C2735DAB527EA5A6C9631009

System.MissingMethodException was unhandled
  Message="Método no encontrado: 'System.Windows.Threading.DispatcherOperation System.Windows.Threading.Dispatcher.BeginInvoke(System.Delegate, System.Object[])'."
  Source="Matrix"
  StackTrace:
       en Matrix.XmppStream.#=qsWF8buiGUsPg4dlvw9zEVQ==(Delegate #=q1ATIt9oIkulrivsM2PGhdA==, Object[] #=qS3fmQfgvR7n9JawlnqjHSw==)
       en Matrix.XmppStream.#=qEAZndxHtv17FBBLsNoSV5Q==(Delegate #=qmztG$uL9V0bsABGpC$1Vew==, Object #=qPInecPl3tUfSZGt4y_mqyA==, EventArgs #=qA0Ssx2YjRnsbPCByHZRqSA==)
       en Matrix.XmppStream.#=qNGH0AZtCi4cp5oD8qRuRLw==(Object #=qSUAw_VCtxFPDhmPjV9qnsw==, ExceptionEventArgs #=q51B6Jc7Hq0TdrlWzMtR_qQ==)
       en Matrix.Net.BaseSocket.FireOnError(Exception ex)
       en Matrix.Net.ClientSocket.#=qzxRu0TqGT1wmXPbDdydIuQ==(IAsyncResult #=qCwvIhZmR83AURA$RXSfjYw==)
       en System.Net.LazyAsyncResult.Complete(IntPtr userToken)
       en System.Net.ContextAwareResult.CompleteCallback(Object state)
       en System.Threading.ExecutionContext.runTryCode(Object userData)
       en System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       en System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       en System.Net.ContextAwareResult.Complete(IntPtr userToken)
       en System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
       en System.Net.Sockets.Socket.ConnectCallback()
       en System.Net.Sockets.Socket.RegisteredWaitCallback(Object state, Boolean timedOut)
       en System.Threading._ThreadPoolWaitOrTimerCallback.PerformWaitOrTimerCallback(Object state, Boolean timedOut)
  InnerException:
Avatar
Alex #6
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
this is the decoded stacktrace:

System.MissingMethodException was unhandled
  Message="Método no encontrado: 'System.Windows.Threading.DispatcherOperation System.Windows.Threading.Dispatcher.BeginInvoke(System.Delegate, System.Object[])'."
  Source="Matrix"
  StackTrace:
       en Matrix.XmppStream.DoRaiseEvent(Delegate del, Object[] args)
       en Matrix.XmppStream.DoRaiseEvent(Delegate del, Object arg1, EventArgs arg2)
       en Matrix.XmppStream.socket_OnError(Object sender, ExceptionEventArgs e)
       en Matrix.Net.BaseSocket.FireOnError(Exception ex)
       en Matrix.Net.ClientSocket.EndConnect(IAsyncResult ar)
       en System.Net.LazyAsyncResult.Complete(IntPtr userToken)
       en System.Net.ContextAwareResult.CompleteCallback(Object state)
       en System.Threading.ExecutionContext.runTryCode(Object userData)
       en System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       en System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       en System.Net.ContextAwareResult.Complete(IntPtr userToken)
       en System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
       en System.Net.Sockets.Socket.ConnectCallback()
       en System.Net.Sockets.Socket.RegisteredWaitCallback(Object state, Boolean timedOut)
       en System.Threading._ThreadPoolWaitOrTimerCallback.PerformWaitOrTimerCallback(Object state, Boolean timedOut)
  InnerException:

it sais methid not found. Are you running against the correct .NET Framework? 3.5 or higher. Have you modified the example code? And are you using the cottect MatriX dll for our platform?

Alex
Avatar
vicmanfran #7
Member since Dec 2011 · 5 posts
Group memberships: Members
Show profile · Link to this post
I've downloaded the .NET installer at http://www.ag-software.net/matrix-xmpp-sdk/download/ and I was testing MiniClient without any modification. It's strange because if I test on a Vista machine the Exception is never thrown, the other machine with that Exception has windows xp sp2 visual studio 2008 and .net framework 3.5 installed.

I have a question involving dns resolve of the jabber hostname, is there any possibility to disable the resolution on agsXmpp? Kaspersky throw me a Warning everytime I connect to the jabber server I know that ip address changes and because of that Im using a third party DNS Client Library http://www.simpledns.com/dns-client-lib.aspx it has a lot of features and the most important thing is that Kaspersky doesnt complain doing the resolution. If I can disable dns resolution on agsXmpp I will give you money for that little change, the application I want to create will be freeware.

Thanks.
Avatar
Alex #8
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
You can modify the sources to disable the DNS resoving. The code is in agsXMPP.Net.ClientSocket.cs.

Alex
Avatar
vicmanfran #9
Member since Dec 2011 · 5 posts
Group memberships: Members
Show profile · Link to this post
Thank you :)
Avatar
Alex #10
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
do a IpAddress.TryParse with the hostname, and only resolve when TryParse returns false.

Alex
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