Hi guys im working on a project at school and I got a problem, I'm able to send UDP packet to different adress but I can't read UDP packet sent to my iPhone, after receiving an UDP packet I want the data to appear in a label, im doing something wrong but I dont know what.....my code :
- (BOOL)onUdpSocket:(AsyncUdpSocket *)sock didReceiveData:(NSData *)data withTag:(long)tag fromHost:(NSString *)host port:(UInt16)port
{
NSLog(@"Incoming data");
[sock receiveWithTimeout:1 tag:0];
NSString *receiveddata = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
// NSString *receiveddata = data ;
self.testudp.text = receiveddata;
return YES;
}