Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
iosys #1
Member since Jul 2010 · 5 posts
Group memberships: Members
Show profile
Subject: File transfer
Hi all,

I downloaded MiniClient.
I'm using openfire as a own server that has public domain.
I tested file transer from A MiniClient to B MiniClient.
Each MiniClient are located different private network. For example A MiniClient is 192.168.3.128, B MiniClient is 192.168.0.2.
When file transfer from A to B, file transfer failed. B received 0KB.
But file transfer is ok on same network.
Debug message as follows:
-----------------------------------
SEND: <iq id="agsXMPP_11" to="iosys.11@iomsn.iosystem.co.kr/MiniClient" type="set"><si xmlns="http://jabber.org/protocol/si" profile="http://jabber.org/protocol/si/profile/file-transfer" id="412dda07-4ae6-4f91-ba4c-54bc3b686003"><file xmlns="http://jabber.org/protocol/si/profile/file-transfer" name="Forest.jpg" size="664489"><range /></file><feature xmlns="http://jabber.org/protocol/feature-neg"><x xmlns="jabber:x:data" type="form"><field type="list-single" var="stream-method"><option><value>http://jabber.org/protocol/bytestreams</value></option></field></x></feature></si></iq>

RECV: <iq xmlns="jabber:client" from="iosys.11@iomsn.iosystem.co.kr/MiniClient" to="iosys.6@iomsn.iosystem.co.kr/MiniClient" type="result" id="agsXMPP_11"><si xmlns="http://jabber.org/protocol/si" id="412dda07-4ae6-4f91-ba4c-54bc3b686003"><feature xmlns="http://jabber.org/protocol/feature-neg"><x xmlns="jabber:x:data" type="submit"><field var="stream-method"><value>http://jabber.org/protocol/bytestreams</value></field></x></feature></si></iq>

SEND: <iq id="agsXMPP_12" to="iosys.11@iomsn.iosystem.co.kr/MiniClient" type="set"><query xmlns="http://jabber.org/protocol/bytestreams" sid="412dda07-4ae6-4f91-ba4c-54bc3b686003"><streamhost jid="iosys.6@iomsn.iosystem.co.kr/MiniClient" host="192.168.3.128" port="1000" /><streamhost jid="iomsn.iosystem.co.kr" host="iomsn.iosystem.co.kr" port="7777" /></query></iq>

RECV: <iq xmlns="jabber:client" from="iosys.11@iomsn.iosystem.co.kr/MiniClient" to="iosys.6@iomsn.iosystem.co.kr/MiniClient" type="result" id="agsXMPP_12"><query xmlns="http://jabber.org/protocol/bytestreams"><streamhost-used jid="iomsn.iosystem.co.kr" /></query></iq>
SEND: <iq id="agsXMPP_13" to="iomsn.iosystem.co.kr" type="set"><query xmlns="http://jabber.org/protocol/bytestreams" sid="412dda07-4ae6-4f91-ba4c-54bc3b686003"><activate>iosys.11@iomsn.iosystem.co.kr/MiniClient</activate></query></iq>

RECV: <iq xmlns="jabber:client" from="iomsn.iosystem.co.kr" to="iosys.6@iomsn.iosystem.co.kr/MiniClient" type="error" id="agsXMPP_13"><query xmlns="http://jabber.org/protocol/bytestreams" sid="412dda07-4ae6-4f91-ba4c-54bc3b686003"><activate>iosys.11@iomsn.iosystem.co.kr/MiniClient</activate></query><error code="501" type="cancel"><feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error></iq>
-----------------------------------

What's the problem?

Greatly appreciate any reply.
This post was edited 3 times, last on 2013-03-08, 13:43 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4298 posts · Location: Germany
Group memberships: Administrators, Members
Show profile
you offer only your external IP in the streamhosts which is probably behind a firewall and cannot be used.

  1. <streamhost jid="iosys.1@iomsn.iosystem.co.kr/IOSMSN" host="192.168.3.128" port="7777" />
  2. <streamhost jid="iomsn.iosystem.co.kr" host="iomsn.iosystem.co.kr" port="7777" />

you have to add an entry for your internal IP here when you want to use it.

Alex
Avatar
iosys #3
Member since Jul 2010 · 5 posts
Group memberships: Members
Show profile
Thank you for replying.

How to add an entry, and add where there?

Thanks.
Avatar
Alex #4
Member since Feb 2003 · 4298 posts · Location: Germany
Group memberships: Administrators, Members
Show profile
SendStreamHosts function in frmFileTransfer.cs

Alex
Avatar
iosys #5
Member since Jul 2010 · 5 posts
Group memberships: Members
Show profile
In reply to post #2
Quote by Alex on 2010-07-19, 07:25:
1279517124

Would you tell me more infomation that specifically with examples?

I'm beginner.
Avatar
Alex #6
Member since Feb 2003 · 4298 posts · Location: Germany
Group memberships: Administrators, Members
Show profile
in SendStreamHosts function in frmFileTransfer.cs


  1. ...
  2. System.Net.IPHostEntry iphe = System.Net.Dns.Resolve(hostname);
  3. for (int i = 0; i < iphe.AddressList.Length; i++)
  4. {  
  5.    // add all adresses here which can be used to establish a peer to peer connection
  6.    bsIq.Query.AddStreamHost(m_XmppCon.MyJID, iphe.AddressList[i].ToString(), 1000);
  7. }
  8. // add file transfer proxies here
  9. bsIq.Query.AddStreamHost(new Jid(PROXY), PROXY, 7777);
  10. ...

Alex
Avatar
iosys #7
Member since Jul 2010 · 5 posts
Group memberships: Members
Show profile
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);
}

First, when sender MiniClient ip is 192.168.3.128 and receiver MiniClient ip is 192.168.3.129, file transer is OK.

Sender MiniClient debug xml:
SEND: <iq id="agsXMPP_11" to="iosys.22@iomsn.iosystem.co.kr/MiniClient" type="set"><si xmlns="http://jabber.org/protocol/si" profile="http://jabber.org/protocol/si/profile/file-transfer" id="34e548ab-28f3-40a0-82a9-d4ba66b4fb55"><file xmlns="http://jabber.org/protocol/si/profile/file-transfer" name="Forest.jpg" size="664489"><range /></file><feature xmlns="http://jabber.org/protocol/feature-neg"><x xmlns="jabber:x:data" type="form"><field type="list-single" var="stream-method"><option><value>http://jabber.org/protocol/bytestreams</value></option></field></x></feature></si></iq>
RECV: <iq xmlns="jabber:client" from="iosys.22@iomsn.iosystem.co.kr/MiniClient" to="iosys.6@iomsn.iosystem.co.kr/MiniClient" type="result" id="agsXMPP_11"><si xmlns="http://jabber.org/protocol/si" id="34e548ab-28f3-40a0-82a9-d4ba66b4fb55"><feature xmlns="http://jabber.org/protocol/feature-neg"><x xmlns="jabber:x:data" type="submit"><field var="stream-method"><value>http://jabber.org/protocol/bytestreams</value></field></x></feature></si></iq>
SEND: <iq id="agsXMPP_12" to="iosys.22@iomsn.iosystem.co.kr/MiniClient" type="set"><query xmlns="http://jabber.org/protocol/bytestreams" sid="34e548ab-28f3-40a0-82a9-d4ba66b4fb55"><streamhost jid="iosys.6@iomsn.iosystem.co.kr/MiniClient" host="192.168.3.128" port="7777" /><streamhost jid="iomsn.iosystem.co.kr" host="iomsn.iosystem.co.kr" port="7777" /><streamhost jid="iosys.6@iomsn.iosystem.co.kr/MiniClient" host="192.168.3.128" port="7777" /></query></iq>
RECV: <iq xmlns="jabber:client" from="iosys.22@iomsn.iosystem.co.kr/MiniClient" to="iosys.6@iomsn.iosystem.co.kr/MiniClient" type="result" id="agsXMPP_12"><query xmlns="http://jabber.org/protocol/bytestreams"><streamhost-used jid="iosys.6@iomsn.iosystem.co.kr/MiniClient" /></query></iq>

Receiver MiniClient debug xml:
RECV: <iq xmlns="jabber:client" from="iosys.6@iomsn.iosystem.co.kr/MiniClient" to="iosys.22@iomsn.iosystem.co.kr/MiniClient" type="set" id="agsXMPP_11"><si xmlns="http://jabber.org/protocol/si" profile="http://jabber.org/protocol/si/profile/file-transfer" id="34e548ab-28f3-40a0-82a9-d4ba66b4fb55"><file xmlns="http://jabber.org/protocol/si/profile/file-transfer" size="664489" name="Forest.jpg"><range /></file><feature xmlns="http://jabber.org/protocol/feature-neg"><x xmlns="jabber:x:data" type="form"><field type="list-single" var="stream-method"><option><value>http://jabber.org/protocol/bytestreams</value></option></field></x></feature></si></iq>
SEND: <iq id="agsXMPP_11" to="iosys.6@iomsn.iosystem.co.kr/MiniClient" type="result"><si xmlns="http://jabber.org/protocol/si" id="34e548ab-28f3-40a0-82a9-d4ba66b4fb55"><feature xmlns="http://jabber.org/protocol/feature-neg"><x xmlns="jabber:x:data" type="submit"><field var="stream-method"><value>http://jabber.org/protocol/bytestreams</value></field></x></feature></si></iq>
RECV: <iq xmlns="jabber:client" from="iosys.6@iomsn.iosystem.co.kr/MiniClient" to="iosys.22@iomsn.iosystem.co.kr/MiniClient" type="set" id="agsXMPP_12"><query xmlns="http://jabber.org/protocol/bytestreams" sid="34e548ab-28f3-40a0-82a9-d4ba66b4fb55"><streamhost port="7777" jid="iosys.6@iomsn.iosystem.co.kr/MiniClient" host="192.168.3.128" /><streamhost port="7777" jid="iomsn.iosystem.co.kr" host="iomsn.iosystem.co.kr" /><streamhost port="7777" jid="iosys.6@iomsn.iosystem.co.kr/MiniClient" host="192.168.3.128" /></query></iq>
SEND: <iq type="result" to="iosys.6@iomsn.iosystem.co.kr/MiniClient" id="agsXMPP_12"><query xmlns="http://jabber.org/protocol/bytestreams"><streamhost-used jid="iosys.6@iomsn.iosystem.co.kr/MiniClient" /></query></iq>

Second, when sender MiniClient ip is 192.168.3.128 and receiver MiniClient ip is 192.168.0.2, occur error code 501.

Sender MiniClient debug xml:
SEND: <iq id="agsXMPP_11" to="iosys.22@iomsn.iosystem.co.kr/MiniClient" type="set"><si xmlns="http://jabber.org/protocol/si" profile="http://jabber.org/protocol/si/profile/file-transfer" id="28d53052-349f-4b4f-a3c1-5be9f766c232"><file xmlns="http://jabber.org/protocol/si/profile/file-transfer" name="Forest.jpg" size="664489"><range /></file><feature xmlns="http://jabber.org/protocol/feature-neg"><x xmlns="jabber:x:data" type="form"><field type="list-single" var="stream-method"><option><value>http://jabber.org/protocol/bytestreams</value></option></field></x></feature></si></iq>
RECV: <iq xmlns="jabber:client" from="iosys.22@iomsn.iosystem.co.kr/MiniClient" to="iosys.6@iomsn.iosystem.co.kr/MiniClient" type="result" id="agsXMPP_11"><si xmlns="http://jabber.org/protocol/si" id="28d53052-349f-4b4f-a3c1-5be9f766c232"><feature xmlns="http://jabber.org/protocol/feature-neg"><x xmlns="jabber:x:data" type="submit"><field var="stream-method"><value>http://jabber.org/protocol/bytestreams</value></field></x></feature></si></iq>
SEND: <iq id="agsXMPP_12" to="iosys.22@iomsn.iosystem.co.kr/MiniClient" type="set"><query xmlns="http://jabber.org/protocol/bytestreams" sid="28d53052-349f-4b4f-a3c1-5be9f766c232"><streamhost jid="iosys.6@iomsn.iosystem.co.kr/MiniClient" host="192.168.3.128" port="7777" /><streamhost jid="iomsn.iosystem.co.kr" host="iomsn.iosystem.co.kr" port="7777" /><streamhost jid="iosys.6@iomsn.iosystem.co.kr/MiniClient" host="192.168.3.128" port="7777" /></query></iq>
RECV: <iq xmlns="jabber:client" from="iosys.22@iomsn.iosystem.co.kr/MiniClient" to="iosys.6@iomsn.iosystem.co.kr/MiniClient" type="result" id="agsXMPP_12"><query xmlns="http://jabber.org/protocol/bytestreams"><streamhost-used jid="iomsn.iosystem.co.kr" /></query></iq>
SEND: <iq id="agsXMPP_13" to="iomsn.iosystem.co.kr" type="set"><query xmlns="http://jabber.org/protocol/bytestreams" sid="28d53052-349f-4b4f-a3c1-5be9f766c232"><activate>iosys.22@iomsn.iosystem.co.kr/MiniClient</activate></query></iq>
RECV: <iq xmlns="jabber:client" from="iomsn.iosystem.co.kr" to="iosys.6@iomsn.iosystem.co.kr/MiniClient" type="error" id="agsXMPP_13"><query xmlns="http://jabber.org/protocol/bytestreams" sid="28d53052-349f-4b4f-a3c1-5be9f766c232"><activate>iosys.22@iomsn.iosystem.co.kr/MiniClient</activate></query><error code="501" type="cancel"><feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error></iq>

Receiver MiniClient debug xml:
RECV: <iq xmlns="jabber:client" from="iosys.6@iomsn.iosystem.co.kr/MiniClient" to="iosys.22@iomsn.iosystem.co.kr/MiniClient" type="set" id="agsXMPP_11"><si xmlns="http://jabber.org/protocol/si" profile="http://jabber.org/protocol/si/profile/file-transfer" id="28d53052-349f-4b4f-a3c1-5be9f766c232"><file xmlns="http://jabber.org/protocol/si/profile/file-transfer" size="664489" name="Forest.jpg"><range /></file><feature xmlns="http://jabber.org/protocol/feature-neg"><x xmlns="jabber:x:data" type="form"><field type="list-single" var="stream-method"><option><value>http://jabber.org/protocol/bytestreams</value></option></field></x></feature></si></iq>
SEND: <iq id="agsXMPP_11" to="iosys.6@iomsn.iosystem.co.kr/MiniClient" type="result"><si xmlns="http://jabber.org/protocol/si" id="28d53052-349f-4b4f-a3c1-5be9f766c232"><feature xmlns="http://jabber.org/protocol/feature-neg"><x xmlns="jabber:x:data" type="submit"><field var="stream-method"><value>http://jabber.org/protocol/bytestreams</value></field></x></feature></si></iq>
RECV: <iq xmlns="jabber:client" from="iosys.6@iomsn.iosystem.co.kr/MiniClient" to="iosys.22@iomsn.iosystem.co.kr/MiniClient" type="set" id="agsXMPP_12"><query xmlns="http://jabber.org/protocol/bytestreams" sid="28d53052-349f-4b4f-a3c1-5be9f766c232"><streamhost port="7777" jid="iosys.6@iomsn.iosystem.co.kr/MiniClient" host="192.168.3.128" /><streamhost port="7777" jid="iomsn.iosystem.co.kr" host="iomsn.iosystem.co.kr" /><streamhost port="7777" jid="iosys.6@iomsn.iosystem.co.kr/MiniClient" host="192.168.3.128" /></query></iq>
SEND: <iq type="result" to="iosys.6@iomsn.iosystem.co.kr/MiniClient" id="agsXMPP_12"><query xmlns="http://jabber.org/protocol/bytestreams"><streamhost-used jid="iomsn.iosystem.co.kr" /></query></iq>

I don't know why file transfer failed in second case.
Avatar
Alex #8
Member since Feb 2003 · 4298 posts · Location: Germany
Group memberships: Administrators, Members
Show profile
Quote by iosys:
Second, when sender MiniClient ip is 192.168.3.128 and receiver MiniClient ip is 192.168.0.2, occur error code 501.
I don't know why file transfer failed in second case.
these IPs are in 2 different subnets. I assume that the receiver cannot connect to the sender. So the transfer fails.
Avatar
iosys #9
Member since Jul 2010 · 5 posts
Group memberships: Members
Show profile
Quote by Alex:
Quote by iosys:
Second, when sender MiniClient ip is 192.168.3.128 and receiver MiniClient ip is 192.168.0.2, occur error code 501.
I don't know why file transfer failed in second case.
these IPs are in 2 different subnets. I assume that the receiver cannot connect to the sender. So the transfer fails.

I came upon this thread in hopes of getting some help in implementing file transfer in second case.

Any help would be greatly appreciated.
Avatar
Alex #10
Member since Feb 2003 · 4298 posts · Location: Germany
Group memberships: Administrators, Members
Show profile
I answered all your questions.

File transfer is a complex topic. You have to study and understand XEP-0065 and have to be familiar with networking. Without understanding the basics you can't solve the problem.

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