Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
jshamid #1
Member since Feb 2007 · 30 posts
Group memberships: Members
Show profile · Link to this post
Subject: Problem in File Transfering
hi, i am implementing the file transfer mecahnism on following the codes from MiniClient sample. But i am getting problems.
1) when i transfer file the other user can get the message to accept the invitation. But after he clicked acept button. file is not transfering.
2) if I want to use sock5 method, how to do that.

i am sending my debug code.

Sender:

SEND: <iq xmlns="jabber:client" id="agsXMPP_16" to="sreedevi@xmpp1.kochi.globees.com/MiniClient" type="set"><si xmlns="http://jabber.org/protocol/si" profile="http://jabber.org/protocol/si/profile/file-transfer" id="5a758e6d-3d7b-4f73-88a2-6797c9e15265"><file xmlns="http://jabber.org/protocol/si/profile/file-transfer" name="jeeva.txt" size="926"><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="sreedevi@xmpp1.kochi.globees.com/GIM" to="shahulhameed@xmpp1.kochi.globees.com/GIM" type="result" id="agsXMPP_16"><si xmlns="http://jabber.org/protocol/si" id="5a758e6d-3d7b-4f73-88a2-6797c9e15265"><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 xmlns="jabber:client" id="agsXMPP_17" to="sreedevi@xmpp1.kochi.globees.com/MiniClient" type="set"><query xmlns="http://jabber.org/protocol/bytestreams" sid="5a758e6d-3d7b-4f73-88a2-6797c9e15265"><streamhost jid="shahulhameed@xmpp1.kochi.globees.com/GIM" host="192.168.0.18" port="8080" /></query></iq>
RECV: <iq xmlns="jabber:client" from="sreedevi@xmpp1.kochi.globees.com/GIM" id="agsXMPP_30" to="shahulhameed@xmpp1.kochi.globees.com/GIM" type="set"><query xmlns="http://jabber.org/protocol/bytestreams" sid="5a758e6d-3d7b-4f73-88a2-6797c9e15265"><streamhost host="192.168.0.18" jid="sreedevi@xmpp1.kochi.globees.com/GIM" port="8080" /></query></iq>


Receiver

RECV: <iq xmlns="jabber:client" from="sree@localhost" id="agsXMPP_24" to="sreedevi@xmpp1.kochi.globees.com/GIM" type="error"><query xmlns="jabber:iq:last" /><error code="404" type="cancel"><remote-server-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error></iq>
RECV: <iq xmlns="jabber:client" from="sarose@srv.globees.com" id="agsXMPP_15" to="sreedevi@xmpp1.kochi.globees.com/GIM" type="error"><query xmlns="jabber:iq:last" /><error code="404" type="cancel"><remote-server-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error></iq>
RECV: <iq xmlns="jabber:client" from="shahulhameed@xmpp1.kochi.globees.com/GIM" id="agsXMPP_16" to="sreedevi@xmpp1.kochi.globees.com/MiniClient" type="set"><si xmlns="http://jabber.org/protocol/si" id="5a758e6d-3d7b-4f73-88a2-6797c9e15265" profile="http://jabber.org/protocol/si/profile/file-transfer"><file xmlns="http://jabber.org/protocol/si/profile/file-transfer" size="926" name="jeeva.txt"><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 xmlns="jabber:client" from="sreedevi@xmpp1.kochi.globees.com/GIM" id="agsXMPP_16" to="shahulhameed@xmpp1.kochi.globees.com/GIM" type="result"><si xmlns="http://jabber.org/protocol/si" id="5a758e6d-3d7b-4f73-88a2-6797c9e15265"><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="shahulhameed@xmpp1.kochi.globees.com/GIM" id="agsXMPP_17" to="sreedevi@xmpp1.kochi.globees.com/MiniClient" type="set"><query xmlns="http://jabber.org/protocol/bytestreams" sid="5a758e6d-3d7b-4f73-88a2-6797c9e15265"><streamhost host="192.168.0.18" jid="shahulhameed@xmpp1.kochi.globees.com/GIM" port="8080" /></query></iq>
SEND: <iq xmlns="jabber:client" id="agsXMPP_30" to="shahulhameed@xmpp1.kochi.globees.com/GIM" type="set"><query xmlns="http://jabber.org/protocol/bytestreams" sid="5a758e6d-3d7b-4f73-88a2-6797c9e15265"><streamhost jid="sreedevi@xmpp1.kochi.globees.com/GIM" host="192.168.0.18" port="8080" /></query></iq>
Avatar
Jabberer #2
Member since Feb 2006 · 249 posts
Group memberships: Members
Show profile · Link to this post
there is no StreamhostUsed in your Xml. Did you try to debug the code of the receiving client where it tries to connect to the offered streamhosts? This code is in the HandleStreamHost function in the MiniClient.

Is there a firewall which blocks incoming sockets?
Software Developer
AG-Software
Avatar
jshamid #3
Member since Feb 2007 · 30 posts
Group memberships: Members
Show profile · Link to this post
greetings.

hi, i am having some problems in file transfereing. When i transfered files from miniclient to psi, progress bar showing that file are being transfered. but other end the progress bar is not showing any identification of receiving files.

this is my debug

Send:
  1. <iq xmlns="jabber:client" id="agsXMPP_28" to="shahulhameed@xmpp1.kochi.globees.com/Psi" type="set">
  2. <si xmlns="http://jabber.org/protocol/si" profile="http://jabber.org/protocol/si/profile/file-transfer" id="88b81200-cc54-4b6b-95d3-d269a4c49cb4">
  3. <file xmlns="http://jabber.org/protocol/si/profile/file-transfer" name="gim ofline.ico" size="161862"><range /></file>
  4. <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>


Rec :
  1. <iq xmlns="jabber:client" from="sarose@srv.globees.com" id="agsXMPP_9" to="sreedevi@xmpp1.kochi.globees.com/GIM" type="error"><query xmlns="jabber:iq:last" /><error code="404" type="cancel"><remote-server-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error></iq>
  2. Rec :<iq xmlns="jabber:client" from="shahulhameed@xmpp1.kochi.globees.com/Psi" id="agsXMPP_28" to="sreedevi@xmpp1.kochi.globees.com/GIM" type="result">
  3. <si xmlns="http://jabber.org/protocol/si">
  4. <feature xmlns="http://jabber.org/protocol/feature-neg">
  5. <x xmlns="jabber:x:data" type="submit">
  6. <field var="stream-method">
  7. <value>http://jabber.org/protocol/bytestreams</value>
  8. </field>
  9. </x>
  10. </feature>
  11. </si>
  12. </iq>


  1. <iq xmlns="jabber:client" id="agsXMPP_29" to="shahulhameed@xmpp1.kochi.globees.com/Psi" type="set">
  2.  <query xmlns="http://jabber.org/protocol/bytestreams" sid="88b81200-cc54-4b6b-95d3-d269a4c49cb4">
  3.  <streamhost jid="sreedevi@xmpp1.kochi.globees.com/GIM" host="192.168.0.113" port="7777" />
  4.  <streamhost jid="proxy.ag-software.de" host="proxy.ag-software.de" port="7777" />
  5.  </query>
  6. </iq>

Rec :
  1. <iq xmlns="jabber:client" from="shahulhameed@xmpp1.kochi.globees.com/Psi" id="agsXMPP_29"  
  2.  to="sreedevi@xmpp1.kochi.globees.com/GIM" type="result">
  3.     <query xmlns="http://jabber.org/protocol/bytestreams">
  4.       <streamhost-used jid="sreedevi@xmpp1.kochi.globees.com/GIM" />
  5.     </query>
  6. </iq>

and also i would like to ask a doubt.
As per my debug code i am sending two streem host like

  1. <streamhost jid="sreedevi@xmpp1.kochi.globees.com/GIM" host="192.168.***.***" port="7777" />
  2.  <streamhost jid="proxy.ag-software.de" host="proxy.ag-software.de" port="7777" />

In the first streamhost which port number i supposed to give, my server portnumber or my system port number and also IP Address

thanks for your coperations
This post was edited on 2013-03-06, 19:04 by Alex.
Avatar
Jabberer #4
Member since Feb 2006 · 249 posts
Group memberships: Members
Show profile · Link to this post
Quote by jshamid:
and also i would like to ask a doubt.
As per my debug code i am sending two streem host like

  <streamhost jid="sreedevi@xmpp1.kochi.globees.com/GIM" host="192.168.***.***" port="7777" />
  <streamhost jid="proxy.ag-software.de" host="proxy.ag-software.de" port="7777" />


In the first streamhost which port number i supposed to give, my server portnumber or my system port number and also IP Address

The first streamhost is you local machine. Its up to you to choose any port you want. Of course the port must be free and not be used by another application and it should not be blocked by your firewall.
Software Developer
AG-Software
Avatar
jshamid #5
Member since Feb 2007 · 30 posts
Group memberships: Members
Show profile · Link to this post
ByteStreamIq bsIq = new ByteStreamIq();
bsIq.To = m_To;
bsIq.Type = IqType.set;

bsIq.Query.Sid = m_Sid;

hostname = System.Net.Dns.GetHostName();         

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, "192.168.0.113", 7777);
    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(_p2pSocks5Socket_OnConnect);
_p2pSocks5Socket.OnDisconnect +=new ObjectHandler(_p2pSocks5Socket_OnDisconnect);
_p2pSocks5Socket.Listen(7777);


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



Now I can transfer files with your help. But i have some doubts on it.

1) When i connect through the proxy why should i listen the port ? and what is the use of this line code
_p2pSocks5Socket.Listen(7777);

2)When we transfer the files through the proxy, will it gets any problem of firewall, etc.

3)Actualy my scenario is :
I want to tranfer the file to other user through the proxy, but I dont want to connect the user directly, and the other user also dont want to connect me , so that he can get the data from proxy.
Will my code works for this scenario.

thanks
Avatar
Alex #6
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by jshamid:
Now I can transfer files with your help. But i have some doubts on it.
good

Quote by jshamid:
1) When i connect through the proxy why should i listen the port ? and what is the use of this line code
_p2pSocks5Socket.Listen(7777);
This opens a listening socket on the sender machine. To transfer a file from one machine to the other you always try to setup a peer to peer connection between both clients first. If this fails then the file transfer proxy is used.

Quote by jshamid:
2)When we transfer the files through the proxy, will it gets any problem of firewall, etc.
normally not. The proxy is a server in the middle like the XMPP server is. If both clients were able to connect to the XMPP server then they normally can also connect to the file transfer proxy. But it's of course possible that a network admin blocks ports and you are not able to connect to the proxy. If your network admin don't wants you to transfer files then he can stop you from doing it.

Quote by jshamid:
3)Actualy my scenario is :
I want to tranfer the file to other user through the proxy, but I dont want to connect the user directly, and the other user also dont want to connect me , so that he can get the data from proxy.
Will my code works for this scenario.
If you use a proxy there is no direct connection. If you don't want a direct connection then offer only the proxy as a streamhost.
But keep in mind that many file-transfers over a proxy is lots of traffic on your server.

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