I am trying now to send an mp3 data to the server app. I am sending UIImage data as per the below code on the client side. But, the issue is, it is NOT sending this mp3 data to the server front end app.I send small mp3 (2kb) than send but large mp3(50mb) not send server how to solve this problem please help.
Code: https://github.com/robbiehanson/CocoaAsyncSocket
- (IBAction)send:(id)sender
{
NSString *host = addrField.text;
if ([host length] == 0)
{
[self logError:@"Address required"];
return;
}
int port = [portField.text intValue];
if (port <= 0 || port > 65535)
{
[self logError:@"Valid port required"];
return;
}
NSString *msg = [[NSBundle mainBundle] pathForResource:@"rr2" ofType:@"mp3"];
if ([msg length] == 0)
{
[self logError:@"Message required"];
return;
}
NSData* data =[[NSData alloc]init];
data= [NSData dataWithContentsOfFile:msg];
udpSocket = [[GCDAsyncUdpSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_main_queue()];
//omitted error checking
[udpSocket enableBroadcast:YES error:nil];
[udpSocket bindToPort:port error:nil];
[udpSocket joinMulticastGroup:host error:nil];
[udpSocket beginReceiving:nil];
[udpSocket sendData:data toHost:host port:port withTimeout:-1 tag:1];
//tag++;
}