0

I'm working on UDP transmission of audio data. I'm using the CocoaAsyncSocket-GCDAsyncUdpSocket. When my project runs on the iPhone 6 I can just receive part of the data. A few seconds later the app can't receive data anymore, but it can still send data. I tried to run on the iPhone 4 and there is no such problem. Can anyone explain what could be going wrong?

David Doria
  • 9,873
  • 17
  • 85
  • 147
Devil
  • 1
  • 1
  • Start with posting you code, that is not working. – sphinks Sep 01 '16 at 09:06
  • I use [_udpSocket sendData:_middata toHost:_otherIPText.text port:i withTimeout:-1 tag:0]; this method to give GCDAsyncUdpSocket audio data , and use - (void)udpSocket:(GCDAsyncUdpSocket *)sock didReceiveData:(NSData *)data fromAddress:(NSData *)address withFilterContext:(id)filterContext this GCDAsyncUdpSocketDelegate to receive data . I find this delegate rely on GCDAsyncUdpSocket do receive method , but my app just run this method few seconds. – Devil Sep 02 '16 at 02:38

1 Answers1

0

Be sure of that you use singleton.I just have the same problem with you,in my case,I do not use singleton that cause there have many objects,and I can't receive data every time.

Kid Lee
  • 31
  • 2
  • Thanks for answer , as you said I try , but it's not working . I try to only use receive data method is worked . When I was use record and receive method together , it will appear questions like I said . I want to know in your objects how to use those two method ? – Devil Sep 05 '16 at 06:36