AsyncUdpSocket
来源:互联网 发布:哪种照相软件好 编辑:程序博客网 时间:2024/06/14 02:15
//client
AsyncUdpSocket *client = [[[AsyncUdpSocket alloc]initWithDelegate:self]autorelease];
[client receiveWithTimeout:-1 tag:0];
[client sendData:[NSData dataWithBytes:@"Hello ansel" length:12]toHost:@"192.168.88.200" port:6100 withTimeout:2.0 tag: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的使用方法及二次封装
- lua 库
- 如何在CentOS 5/6上安装EPEL 源
- Mac OS X下显示/隐藏文件
- 设计模式系列:策略模式
- 优秀开源代码解读之JS与iOS Native Code互调的优雅实现方案
- AsyncUdpSocket
- Failed on connection exception: java.net.ConnectException
- 设计模式系列:适配器模式
- Spark的运行模式
- db2下名称中含特殊字符的schema名删除
- register
- 设计模式系列:迭代器模式
- The application's PagerAdapter changed the adapter's contents without calling PagerAdapter#notifyDat
- Java解析properties