Issue with sending large image file using Turnsocket #102

Open
erickadoe opened this Issue Aug 22, 2012 · 1 comment

Comments

Projects
None yet
2 participants

Hey

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.

Ericka

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:@"conference.mini.local",@"pubsub.mini.local", @"vjud.mini.local", 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 @[@"conference.mini.local", @"pubsub.mini.local", @"vjud.mini.local"] is when i was send the
-(BOOL)getProxyServers
{
NSError *error = nil;
NSString *strXML = @"<iq type='get'
from='test1@mini.local'
to='mini.local'
id='server_items'>

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

[_xmppStream sendElement:qust];

}
and then I received the proxy_item @[@"conference.mini.local", @"pubsub.mini.local", @"vjud.mini.local"].
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