XMPPFramework
XMPPFramework copied to clipboard
XMPPOutgoingFileTransfer not making direct connection with android smack
Hi,
I got into this issue where I am attempting to make a direct connection to transfer file to android smack library, but it is always connecting via proxy. I made some changes on socks5ReadDomain method where I am passing hash length instead of [_localIPAddress UTF8String].length. By this I could able to connect directly to android. Do this change have any effect on functioning of file transfer. Any help would be appreciated.
Thanks
@guptatarun84 did your chat portion working between xmpp framework and asmack? I did try but not working...any help will be appriciated
Yes it's working now. What help do you need?
Can you be more specific to what error you are seeing? Please refer http://jonathonstaff.com/blog/tackling-file-transfers-with-the-xmppframework/ and sample on https://github.com/nplexity/xmpp-file-transfer-demo. This would need an IP address on which your server is hosted!
@guptatarun84 can you show me your proxy_65's setting that in proxy's server , i can not send file to Adium, and show "ERROR 503 server-unvaliable".
its is similar to what is mention by @jonstaff . Although you can check it below:
mod_proxy65: host: "proxy.xxxx" name: "File Transfer Proxy" ip: "0.0.0.0" port: 7777 hostname: "Your server IP"
503 comes when the other peer is not connected to XMPPStream.
@guptatarun84 i can send file success in the LAN , but can not send file by 4G. what's worry? i think that something error in server, do you have any other ideals that can provide me.
@guptatarun84
ERROR:
Outgoing file transfer failed with error: Error Domain=GCDAsyncSocketErrorDomain Code=2 "Invalid host parameter (nil or ""). Should be a domain name or IP address string." UserInfo={NSLocalizedDescription=Invalid host parameter (nil or ""). Should be a domain name or IP address string.}
Can you post a code snippet? I would also require logs for the stream-host you are providing for a connection. Seeing above logs, it seems a receiver is attempting to make socket connection to an nil IP Address. For a 4G connection use mod_proxy65 setting as discussed above.
@guptatarun84 can you send the file by 4G. have you used the XEP-0095 and XEP-0096? i just use the demo https://github.com/nplexity/xmpp-file-transfer-demo , the demo can not send file by 4G too. so i do not know how you send file success by the same demo.
XEP-0096 is used for file transfer and I have used the same. Same is been used in https://github.com/nplexity/xmpp-file-transfer-demo. Can you send the logs of complete SI negotiation which happened before you get this error? I am sure you are making connection to an empty HOST which results in this error (Same in the case of 4G). The host would be proxy.SERVERNAME which is implemented using mod_proxy65 on server and is returned during discovery information of such addresses. Either your client not able to discover the server proxy details or you have wrong configuration set up on server. Just check this by commenting the discovery snippet [self queryProxyDiscoItems]; and replacing it by below two lines: NSString *tempString = [NSString stringWithFormat:@"proxy.%@",SERVERNAME]; [self queryProxyAddressWithJID:[XMPPJID jidWithString:tempString]];
Let me know the results
i have change the code you asked. in the same wifi. send file is success.the log below. it's the sender's log.
2015-12-22 19:18:04.261 pirate[789:225573] XMPPOutgoingFileTransfer:startFileTransfer
2015-12-22 19:18:04:265 pirate[789:4917] 4-SEND:
the sender in the wifi , the receive in 4G send file failed. it's the sender's log and the receive's log below.
2015-12-22 19:22:32.468 pirate[789:225573] XMPPOutgoingFileTransfer:startFileTransfer
2015-12-22 19:22:32:471 pirate[789:e6b] 4-SEND:
the receive's log:
2015-12-22 19:26:22:377 pirate[789:5a67] 3-RECV:
Please send me IQ stanza's logs for both incoming and outgoing side. Also, check in XMPPIncomingFileTransfer - > attemptStreamhostsConnection -> Value of host (Should not be nil).
i am so sorry, i show all the logs,but Github do not show integrally,this is my e-mail,can you give me your email's address. [email protected]
Sure, [email protected]
Any solution to this @guptatarun84 @lionsom, I am facing same issue for 4G data vs Wifi. Please let me know as earliest as possible.
@lionsom @guptatarun84 Can you suggest to us what was the issue why the host getting nil when we are sending anything device to device?