Not logged in. · Lost password · Register
Forum: agsXMPP SDK Support RSS
Avatar
BringerOD #1
Member since Dec 2005 · 12 posts
Group memberships: Members
Show profile · Link to this post
Subject: MiniClient Error
In the miniclient example, of which I have not modified,  I am having a problem, sending out and receiving chat.

I use pandion as the other client for the test.  I send a chat request to the miniclient from pandion then reply back,  repeat this one more time and the system breaks with the following error.

Any suggestions?

  m_NetworkStream.BeginWrite(bData, 0, bData.Length, new AsyncCallback(EndSend), null);
Error

Unable to write data to the transport connection: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'..

Below is the block of code this is in


    /// <summary>
        /// Send data to the server.
        /// </summary>
        public override void Send(byte[] bData)
        {
            base.FireOnSend(bData, bData.Length);
           
            // .NET 2.0 SSL Stream issues when sending multiple async packets
            // http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=124213&SiteID=1
            if (m_PendingSend)
                m_SendQueue.Enqueue(bData);
            else
            {              
                m_PendingSend = true;
                m_NetworkStream.BeginWrite(bData, 0, bData.Length, new AsyncCallback(EndSend), null);
            }          
        }
Avatar
Alex #2
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hello,

it looks like your connection got closed for some reason when you send this message.
Coud you paste your debug XML? Or track down when the object gets disposed?
Its also possible that Pandion sends message events which are not covered in the MiniClient.

Alex
Alexander Gnauck
AG-Software
Avatar
BringerOD #3
Member since Dec 2005 · 12 posts
Group memberships: Members
Show profile · Link to this post
SEND: <stream:stream to='czar' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>
RECV: <stream:stream xmlns:stream=&quot;http://etherx.jabber.org/streams&quot; from=&quot;czar&quot; version=&quot;1.0&quot; xml:lang=&quot;en&quot; id=&quot;d2031f46&quot; >
RECV: <stream:features xmlns:stream=&quot;http://etherx.jabber.org/streams&quot;><starttls xmlns=&quot;urn:ietf:params:xml:ns:xmpp-tls&quot; /><mechanisms xmlns=&quot;urn:ietf:params:xml:ns:xmpp-sasl&quot;><mechanism>CRAM-MD5</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism></mechanisms><auth xmlns=&quot;http://jabber.org/features/iq-auth&quot; /><register xmlns=&quot;http://jabber.org/features/iq-register&quot; /></stream:features>
SEND: <starttls xmlns=&quot;urn:ietf:params:xml:ns:xmpp-tls&quot; />
RECV: <proceed xmlns=&quot;urn:ietf:params:xml:ns:xmpp-tls&quot; />
SEND: <stream:stream to='czar' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>
RECV: <stream:stream xmlns:stream=&quot;http://etherx.jabber.org/streams&quot; from=&quot;czar&quot; version=&quot;1.0&quot; xml:lang=&quot;en&quot; id=&quot;d2031f46&quot; >
RECV: <stream:features xmlns:stream=&quot;http://etherx.jabber.org/streams&quot;><mechanisms xmlns=&quot;urn:ietf:params:xml:ns:xmpp-sasl&quot;><mechanism>CRAM-MD5</mechanism><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism></mechanisms><auth xmlns=&quot;http://jabber.org/features/iq-auth&quot; /><register xmlns=&quot;http://jabber.org/features/iq-register&quot; /></stream:features>
SEND: <auth xmlns=&quot;urn:ietf:params:xml:ns:xmpp-sasl&quot; mechanism=&quot;DIGEST-MD5&quot; />
RECV: <challenge xmlns=&quot;urn:ietf:params:xml:ns:xmpp-sasl&quot;>cmVhbG09ImN6YXIiLG5vbmNlPSJZdWQzT05CVWVwVkxTbEljanEwVDNiOTBhS1cxcXM2OWc0R1A5anQ0Iixxb3A9ImF1dGgiLGNoYXJzZXQ9InV0Zi04IixhbGdvcml0aG09Im1kNS1zZXNzIg==</challenge>
SEND: <response xmlns=&quot;urn:ietf:params:xml:ns:xmpp-sasl&quot;>dXNlcm5hbWU9InRlc3QiLHJlYWxtPSJjemFyIixub25jZT0iWXVkM09OQlVlcFZMU2xJY2pxMFQzYjkwYUtXMXFzNjlnNEdQOWp0NCIsY25vbmNlPSJkYWViZWM4NGU3YzVhZjQxYmQ4M2U1NTE5YTlmOGI2ZDczODY1NDNhOGRjZjFkYzM1YWE5MzgzNDRhNDJkNzM3IixuYz0wMDAwMDAwMSxxb3A9YXV0aCxkaWdlc3QtdXJpPSJ4bXBwL2N6YXIiLGNoYXJzZXQ9dXRmLTgscmVzcG9uc2U9MmFmZjQyZDNlMGZiNDA3MGEyZmEyZTM3NjJiYjdmZmM=</response>
RECV: <success xmlns=&quot;urn:ietf:params:xml:ns:xmpp-sasl&quot; />
SEND: <stream:stream to='czar' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>
RECV: <stream:stream xmlns:stream=&quot;http://etherx.jabber.org/streams&quot; from=&quot;czar&quot; version=&quot;1.0&quot; xml:lang=&quot;en&quot; id=&quot;d2031f46&quot; >
RECV: <stream:features xmlns:stream=&quot;http://etherx.jabber.org/streams&quot;><bind xmlns=&quot;urn:ietf:params:xml:ns:xmpp-bind&quot; /><session xmlns=&quot;urn:ietf:params:xml:ns:xmpp-session&quot; /></stream:features>
SEND: <iq xmlns=&quot;jabber:client&quot; id=&quot;agsXMPP_1&quot; type=&quot;set&quot; to=&quot;czar&quot;><bind xmlns=&quot;urn:ietf:params:xml:ns:xmpp-bind&quot;><resource>MiniClient</resource></bind></iq>
RECV: <iq xmlns=&quot;jabber:client&quot; from=&quot;czar&quot; to=&quot;czar/d2031f46&quot; type=&quot;result&quot; id=&quot;agsXMPP_1&quot;><bind xmlns=&quot;urn:ietf:params:xml:ns:xmpp-bind&quot;><jid>test@czar/MiniClient</jid></bind></iq>
SEND: <iq xmlns=&quot;jabber:client&quot; id=&quot;agsXMPP_2&quot; type=&quot;set&quot; to=&quot;czar&quot;><session xmlns=&quot;urn:ietf:params:xml:ns:xmpp-session&quot; /></iq>
RECV: <iq xmlns=&quot;jabber:client&quot; from=&quot;czar&quot; to=&quot;test@czar/MiniClient&quot; type=&quot;result&quot; id=&quot;agsXMPP_2&quot;><session xmlns=&quot;urn:ietf:params:xml:ns:xmpp-session&quot; /></iq>
SEND: <iq xmlns=&quot;jabber:client&quot; id=&quot;agsXMPP_3&quot; type=&quot;get&quot; to=&quot;czar&quot;><query xmlns=&quot;jabber:iq:agents&quot; /></iq>
SEND: <iq xmlns=&quot;jabber:client&quot; id=&quot;agsXMPP_4&quot; type=&quot;get&quot;><query xmlns=&quot;jabber:iq:roster&quot; /></iq>
RECV: <iq xmlns=&quot;jabber:client&quot; from=&quot;czar&quot; to=&quot;test@czar/MiniClient&quot; type=&quot;error&quot; id=&quot;agsXMPP_3&quot;><query xmlns=&quot;jabber:iq:agents&quot; /><error code=&quot;501&quot; type=&quot;cancel&quot;><feature-not-implemented xmlns=&quot;urn:ietf:params:xml:ns:xmpp-stanzas&quot; /></error></iq>
RECV: <iq xmlns=&quot;jabber:client&quot; to=&quot;test@czar/MiniClient&quot; type=&quot;result&quot; id=&quot;agsXMPP_4&quot;><query xmlns=&quot;jabber:iq:roster&quot;><item jid=&quot;admin@czar&quot; subscription=&quot;from&quot; /></query></iq>
SEND: <presence xmlns=&quot;jabber:client&quot;><status /><priority>10</priority></presence>
RECV: <iq xmlns=&quot;jabber:client&quot; from=&quot;admin@czar/Pandion&quot; to=&quot;test@czar/MiniClient&quot; type=&quot;get&quot; id=&quot;sd76&quot;><query xmlns=&quot;jabber:iq:version&quot; /></iq>
SEND: <iq xmlns=&quot;jabber:client&quot; id=&quot;sd76&quot; from=&quot;test@czar/MiniClient&quot; to=&quot;admin@czar/Pandion&quot; type=&quot;result&quot;><query xmlns=&quot;jabber:iq:version&quot;><name>MiniClient</name><version>0.5</version><os>Microsoft Windows NT 5.1.2600 Service Pack 2</os></query></iq>
RECV: <message xmlns=&quot;jabber:client&quot; from=&quot;admin@czar/Pandion&quot; to=&quot;test@czar/MiniClient&quot; type=&quot;chat&quot; id=&quot;sd77&quot;><body>test</body><html xmlns=&quot;http://jabber.org/protocol/xhtml-im&quot;><body xmlns=&quot;http://www.w3.org/1999/xhtml&quot;><span style=&quot;font-weight: normal; font-size: 9pt; color: #004200; font-style: normal; font-family: arial&quot;>test</span></body></html><x xmlns=&quot;jisp:x:jep-0038&quot;><name>megapack</name></x><active xmlns=&quot;http://jabber.org/protocol/chatstates&quot; /></message>
RECV: <message xmlns=&quot;jabber:client&quot; from=&quot;admin@czar/Pandion&quot; to=&quot;test@czar/MiniClient&quot; type=&quot;chat&quot; id=&quot;sd78&quot;><body>test</body><html xmlns=&quot;http://jabber.org/protocol/xhtml-im&quot;><body xmlns=&quot;http://www.w3.org/1999/xhtml&quot;><span style=&quot;font-weight: normal; font-size: 9pt; color: #004200; font-style: normal; font-family: arial&quot;>test</span></body></html><x xmlns=&quot;jisp:x:jep-0038&quot;><name>megapack</name></x><active xmlns=&quot;http://jabber.org/protocol/chatstates&quot; /></message>
SEND: <message xmlns=&quot;jabber:client&quot; type=&quot;chat&quot; to=&quot;admin@czar/Pandion&quot;><body>test</body></message>
Avatar
Alex #4
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
this debug looks ok. Did you try to set a breakpoint in the OnMessage handler to see what happens?

Alex
Alexander Gnauck
AG-Software
Avatar
BringerOD #5
Member since Dec 2005 · 12 posts
Group memberships: Members
Show profile · Link to this post
Scenario

1.    Start MiniClient in Debug (With breakpoint on onmessage)
2.    Login to Test Account
3.    Start Pandion on remote machine
4.    Login to Test Account
5.    Send a message from Pandion to MiniClient
6.    MiniClient received ok and display message. (Incoming Breakpoint breaks correctly)
7.    Send another message.
8.    MiniClinet does not receive the message.
9.    NO Incoming Breakpoint

I have tested the server and the accounts by putting trying two pandion clients with each account logged in and they work great.

Any suggestions?

Bryan
Avatar
BringerOD #6
Member since Dec 2005 · 12 posts
Group memberships: Members
Show profile · Link to this post
Subject: PS
When I try the MiniClient against the miniclient.  All works

So its the communication between the MiniClient and pandion client.  Seems wierd?

Can you try this and let me know.  All you will need to do to reproduce is use a pandion client and the miniclient.  It will error out.

Bryan
Avatar
Alex #7
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hi,

did you put a breakpoint on both message callbacks?
There is one in the main form and there is on in the message form.
I will try this scenario tomorrow myself with a pandion client. Now its nap time ;-)

Alex
Alexander Gnauck
AG-Software
Avatar
BringerOD #8
Member since Dec 2005 · 12 posts
Group memberships: Members
Show profile · Link to this post
Tried both on the main form and the chat window?

I think you are right there is something wierd with the pandion client communication?

Bryan
Avatar
Alex #9
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hello,

i downloaded pandion and send several messages. I had no problems.
I tried the sample source from the download page with VS 2003, and i tried the latest developer code on VS2005. Everythink ok for me.
Did you login both clients with the same user ID or with a different user ID?

Alex
Alexander Gnauck
AG-Software
Avatar
BringerOD #10
Member since Dec 2005 · 12 posts
Group memberships: Members
Show profile · Link to this post
Wierd!

Different ID's

I am using http://www.jivesoftware.org/wildfire/  as the server if that makes a difference.

I am using 2005 to compile the application.  Hmm. . .

I will download and the latest examples and library again and test.

I was pretty sure I had the latest.  But will check.
Avatar
BringerOD #11
Member since Dec 2005 · 12 posts
Group memberships: Members
Show profile · Link to this post
I am using the MiniCLientVB!  :)

That might be the difference!

Bryan
Avatar
Alex #12
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Thats possible. Could you try it with the C# version?

Alex
Alexander Gnauck
AG-Software
Avatar
soroosh #13
Member since Dec 2005 · 6 posts
Group memberships: Members
Show profile · Link to this post
Subject: Status Error
Hi,

In MiniClient when I change the status (for example set "online" to "offline") I recieve this error:

System.ArgumentException was unhandled
  Message="Requested value 'offline' was not found."
Source="mscorlib"
  StackTrace:
       at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
       at System.Enum.Parse(Type enumType, String value)
       at MiniClient.frmMain.cboStatus_SelectedValueChanged(Object sender, EventArgs e) in C:\Messenger\agsXMPP\MiniClient\frmMain.cs:line 839
       at System.Windows.Forms.ListControl.OnSelectedValueChanged(EventArgs e)
       at System.Windows.Forms.ComboBox.OnSelectedValueChanged(EventArgs e)
       at System.Windows.Forms.ComboBox.OnSelectedIndexChanged(EventArgs e)
       at System.Windows.Forms.ComboBox.WmReflectCommand(Message& m)
       at System.Windows.Forms.ComboBox.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.Control.ReflectMessageInternal(IntPtr hWnd, Message& m)
       at System.Windows.Forms.Control.WmCommand(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
       at System.Windows.Forms.Control.DefWndProc(Message& m)
       at System.Windows.Forms.Control.WmCommand(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ComboBox.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at MiniClient.frmMain.Main() in C:\Messenger\agsXMPP\MiniClient\frmMain.cs:line 489
       at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()


Occurs in frmMain.cs at:
        private void cboStatus_SelectedValueChanged(object sender, System.EventArgs e)
        {
            if (XmppCon != null && XmppCon.Authenticated)
            {
                if (cboStatus.Text == &quot;online&quot;)
                {
                    XmppCon.Show = ShowType.NONE;
                }
                else
                {
                    XmppCon.Show = (ShowType) Enum.Parse(typeof(ShowType), cboStatus.Text);
                }
                XmppCon.SendMyPresence();
            }
        }
     in this line:  XmppCon.Show = (ShowType) Enum.Parse(typeof(ShowType), cboStatus.Text);

Can you help me? where is the problem?

Thank you
Avatar
Alex #14
Member since Feb 2003 · 4245 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hello,

this is a bug in the MiniClient for the offline status.
Please update the ComboBox event to the following code:

private void cboStatus_SelectedValueChanged(object sender, System.EventArgs e)
{
    if (XmppCon != null && XmppCon.Authenticated)
    {
        if (cboStatus.Text == &quot;online&quot;)
        {
            XmppCon.Show = ShowType.NONE;
        }
        else if (cboStatus.Text == &quot;offline&quot;)
        {
            XmppCon.Close();
        }
        else
        {
            XmppCon.Show = (ShowType)Enum.Parse(typeof(ShowType), cboStatus.Text);
            }
        XmppCon.SendMyPresence();
    }
}

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