Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
xd125 #1
Member since Sep 2008 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: got exception when send iq to roster
hi, folks:
i have a user account, the user has 182 roster item, when i use AgsXmppConnection to send iq to all of the 182 roster items, i got a exception from client socket's end connect method:
private void EndConnect(IAsyncResult ar)
        {
            if (m_ConnectTimedOut)
            {
                base.FireOnError(new ConnectTimeoutException("Attempt to connect timed out"));
            }
            else
            {
                try
                {
                    // stop the timeout timer
                    connectTimeoutTimer.Dispose();

                    // pass connection status with event
                    _socket.EndConnect(ar);
                   
                    m_Stream = new NetworkStream(_socket, false);

                    m_NetworkStream = m_Stream;
#if SSL || MONOSSL
                    if (m_SSL)
                        InitSSL();
#endif
                    FireOnConnect();

                    // Setup Receive Callback
                    this.Receive();
                }
                catch (Exception ex)
                {                  
                    base.FireOnError(ex);
                }
            }
        }

the exception occured from this line:  _socket.EndConnect(ar);
"Exception System.ArgumentException was thrown in debugee:
The IAsyncResult object was not returned from the corresponding asynchronous method on this class."

any idears?
Avatar
Alex #2
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
when you are connected and retrieved your roster and are able to send packets it makes no sense to get an exception in teh EndConnect callback.

Why are you sending iqs to your complete roster? This sounds like a design issue to me.
If you really have todo this then you should send the packets slowly with a timer. Because most public servers disconnect client which send to many packets in a short period of time to prevent SPAM on the XMPP network. If you run your own server you have to adjust the karma on c2s connections on your server to allow this amount of traffic.

Alex
Avatar
xd125 #3
Member since Sep 2008 · 2 posts
Group memberships: Members
Show profile · Link to this post
thanks for the reply, alex,i made a function that user can change there head image, i store the image into the vcard, when the vcard has been changed, i want to send iq to inform all my rosters to update my vcard info
Avatar
Jabberer #4
Member since Feb 2006 · 249 posts
Group memberships: Members
Show profile · Link to this post
thats wrong. Please use the forums search, user avatars were discussed often here before.
Software Developer
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 RSS