当前位置:编程学习 > wap >>

udp通信问题 急求解 懂的童鞋进来 感谢了!!!!

使用udp通信 

        [asyncUdpSocket sendData:MessageData
                          toHost:@"220.135.124.213"                            
                            port:18888
                     withTimeout:-1
                             tag:1];
        free(dataHead);//释放内存空间
        [asyncUdpSocket receiveWithTimeout:0 tag:0];

      接收线程已经开启 ,初始化socket,就是不能进 接收回调数据的方法
   - (BOOL)onUdpSocket:(AsyncUdpSocket *)sock didReceiveData:(NSData *)data withTag:(long)tag fromHost:(NSString *)host port:(UInt16)port

  一直进不了 到底是哪里的问题,搞了好久不明白。。。。。。


求解!!!!!!!!!!!!!! --------------------编程问答-------------------- 难道说socket没有创建好??? --------------------编程问答-------------------- 创建过程返回的正确么? --------------------编程问答-------------------- asyncUdpSocket = [AsyncUdpSocket alloc]initWithDelegate:self]; 
asyncsocket  udp的没用过  tcp的用过。声明的时候以上面这种方式试试。 --------------------编程问答-------------------- delegate设置了吗
补充:移动开发 ,  iPhone
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,