Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
jkddg #1
Member since Dec 2008 · 7 posts
Group memberships: Members
Show profile · Link to this post
Subject: can't send file with MiniClient
I can't send file from MiniClient to spark
but MiniClient can receive file from spark

private void ActivateBytestreamResult(object sender, IQ iq, object dat)
        {
            if ([b]iq.Type [/b]== IqType.result)
            {
                SendFile(null);
            }
        }

iq.Type get error 501

Server: openfire 3.6.2
Port 5222,9090,9091,7777,3478,3479,5269 opened
Avatar
jkddg #2
Member since Dec 2008 · 7 posts
Group memberships: Members
Show profile · Link to this post
maybe my question so easy that no one want to tell me what's the matter?
my English is poor ,but i think you may understand what i means


frmFileTransfer.cs

m_XmppCon.IqGrabber.SendIq(bsIq, new IqCB(ActivateBytestreamResult), null);

private void ActivateBytestreamResult(object sender, IQ iq, object dat)
        {
            if (iq.Type == IqType.result)// here iq return error number 501
            {
                SendFile(null);
            }
        }

<iq xmlns="jabber:client" from="talk.drugnet.com.cn" to="jkddg@talk.drugnet.com.cn/agsXMPP" type="error" id="agsXMPP_13">
<query xmlns="http://jabber.org/protocol/bytestreams" sid="a5377b4d-90dc-4856-b69d-bd8f90db0130">
<activate>jkddg1@talk.drugnet.com.cn/agsXMPP</activate>
</query>
<error code="501" type="cancel">
<feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
</error>
</iq>
Avatar
jkddg #3
Member since Dec 2008 · 7 posts
Group memberships: Members
Show profile · Link to this post
It stops here
[Image: http://211.99.195.195/file.gif]

and Receiver MiniClient throw exception "the object had disposed,can't use it"
[Image: http://211.99.195.195/file1.gif]
Avatar
jkddg #4
Member since Dec 2008 · 7 posts
Group memberships: Members
Show profile · Link to this post
Subject: I did it
Quote by rose5178 on 2008-05-03, 04:52:
I know how can transfer file between miniclient and spark.
You change code like this:

 private void SendStreamHosts()
        {
            ByteStreamIq bsIq = new ByteStreamIq();
            bsIq.To = m_To;
            bsIq.Type = IqType.set;

            bsIq.Query.Sid = m_Sid;
           
            string hostname = System.Net.Dns.GetHostName();         

            System.Net.IPHostEntry iphe = System.Net.Dns.Resolve(hostname);

            for (int i = 0; i < iphe.AddressList.Length; i++)
            {
                Console.WriteLine("IP address: {0}", iphe.AddressList[i].ToString());
               
                bsIq.Query.AddStreamHost(m_XmppCon.MyJID, iphe.AddressList[i].ToString(),7777);           }
          
            bsIq.Query.AddStreamHost(new Jid(PROXY), PROXY, 7777);
           
            _p2pSocks5Socket = new JEP65Socket();
            _p2pSocks5Socket.Initiator = m_XmppCon.MyJID;
            _p2pSocks5Socket.Target = m_To;
            _p2pSocks5Socket.SID = m_Sid;
            _p2pSocks5Socket.OnConnect += new ObjectHandler(_socket_OnConnect);
            _p2pSocks5Socket.OnDisconnect += new ObjectHandler(_socket_OnDisconnect);
            _p2pSocks5Socket.Listen(7777);


            m_XmppCon.IqGrabber.SendIq(bsIq, new IqCB(SendStreamHostsResult), null);
        }


And send file 's client is not on the same computer of the openfire.
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