Issue with sending large image file using Turnsocket #102

erickadoe opened this Issue Aug 22, 2012 · 1 comment


None yet
2 participants


When I am using writeData and readDatatoData to transfer a small file (like 4-5kb), it works. But when I try to send 25kb file, it breaks.

Could you please let me know the usage of
readDatatoLength to read a large file

So that I can read file in chunks and assemble it at the other end.


Hi, erickadoe, I'm used the XMPPFrameWork TurnSocket to transmit file, my server is jabberd , i can send file by iChat and Adium. but when i was use the code send file, the "- (void)turnSocketDidFail:(TURNSocket *)sender" was called every times. this is my code:
NSArray * array = [NSArray arrayWithObjects:@"",@"", @"", nil]; //
[TURNSocket setProxyCandidates: array];

XMPPJID *jid = [XMPPJID jidWithString : @"test2@mini.local/mini" ];
_objTURNSocket = [[TURNSocket alloc] initWithStream:_xmppStream toJID:  jid ];
[_objTURNSocket startWithDelegate:self delegateQueue:dispatch_get_main_queue() ];

the array @[@"", @"", @""] is when i was send the
NSError *error = nil;
NSString *strXML = @"<iq type='get'

" ;
NSXMLElement *qust = [[NSXMLElement alloc] initWithXMLString: strXML error: &error ];
NSLog(@"err :%@", error);

[_xmppStream sendElement:qust];

and then I received the proxy_item @[@"", @"", @""].
please help me!! thanks. best wish to you!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment