GCDAsyncUdpSocket, how to know when you don't receive data

232 views Asked by At

I'm working on an iOS application. I have a target that will send me a response anytime I send it data. I've implemented GCDAsyncUdpSocket and I can send and receive data without a problem. I would like to handle the case when data is not sent back from the target. This is what I send:

[udpSocket sendData:data toHost:@"239.255.255.250" port:1900 withTimeout:-1 tag:0];

In the case that I do receive data, this is called:

- (void)udpSocket:(GCDAsyncUdpSocket *)sock didReceiveData:(NSData *)data
                                         fromAddress:(NSData *)address
                                   withFilterContext:(id)filterContext;

But if nothing is sent back, how will I know? Is there a flag or notification or something I can evaluate after sending data to know whether or not something was received?

0

There are 0 answers