AsyncUdpSocket
来源:互联网 发布:数值最优化算法与理论 编辑:程序博客网 时间:2024/06/05 06:55
//client
AsyncUdpSocket *client = [[[AsyncUdpSocketalloc]initWithDelegate:self]autorelease];
[clientreceiveWithTimeout:-1 tag:0];
[clientsendData:[NSDatadataWithBytes:@"Hello ansel"length:12] toHost:@"192.168.88.200"port:6100 withTimeout:2.0tag:1];
#pragma mark -
#pragma mark AsyncUdpSocketDelegate
- (void)onUdpSocket:(AsyncUdpSocket *)sock didSendDataWithTag:(long)tag
{
NSLog(@"----------");
}
- (void)onUdpSocket:(AsyncUdpSocket *)sock didNotSendDataWithTag:(long)tag dueToError:(NSError *)error
{
NSLog(@"-----err-----");
}
- (BOOL)onUdpSocket:(AsyncUdpSocket *)sock didReceiveData:(NSData *)data withTag:(long)tag fromHost:(NSString *)host port:(UInt16)port
{
}
/**
* Called if an error occurs while trying to receive a requested datagram.
* This is generally due to a timeout, but could potentially be something else if some kind of OS error occurred.
**/
- (void)onUdpSocket:(AsyncUdpSocket *)sock didNotReceiveDataWithTag:(long)tag dueToError:(NSError *)error
{
}
/**
* Called when the socket is closed.
* A socket is only closed if you explicitly call one of the close methods.
**/
- (void)onUdpSocketDidClose:(AsyncUdpSocket *)sock
{
}
- AsyncUdpSocket
- AsyncUdpSocket
- iOS AsyncUdpSocket使用简介
- CAsysncSocket 之--udp工具--AsyncUdpSocket 用法
- CAsysncSocket 之--udp工具--AsyncUdpSocket 用法
- 利用AsyncUdpSocket实现局域网下的IM(含Demo)
- 利用AsyncUdpSocket实现局域网下的IM(含Demo)
- 关于ios调用第三方asyncUdpSocket闪退的解决方法
- Socket UDP通信之 AsyncUdpSocket的使用方法及二次封装
- 编译原理学习周入门教程--(6)句型的分析
- VC 窗口创建以及窗口之间传递数据、传递消息(模态、非模态)
- 有用的软件收集
- hibernate一对多问题处理
- google 地图定位 用到的一些类以及一些方法
- AsyncUdpSocket
- centos安装nginx
- 正则表达式30分钟入门教程
- htons(), htonl(), ntohs(), ntohl()
- 贷方发生额,贷方余额,借方发生额,借方余额,余额跟发生额什么关系?贷款累计发生额
- 我的惯例贴
- 将Java程序作成exe文件的几种方法
- linux到底在何时panic
- Android Develop Training中文翻译01《Getting Started》